Mix.install([
{:kino, "~> 0.13"},
{:phoenix, "~> 1.7"},
{:phoenix_live_view, "~> 0.20"},
{:plug_cowboy, "~> 2.7"}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule MyApp.ReplicatedConCache do | |
| @moduledoc """ | |
| Utility to replicate local ConCache operations via Phoenix.PubSub. | |
| Only those ConCache functions that we need are replicated. | |
| Prerequisites: | |
| - for all relevant cache ids, there is a ConCache instance running on | |
| each node connected to the PubSub system | |
| - these ConCache instances are all configured same (TTL etc.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Super.RepoTest do | |
| use Super.DataCase, async: true | |
| require Logger | |
| @skipped_schemas [UserService.User] | |
| defp tenant_schemas do | |
| {:ok, mods} = :application.get_key(:super, :modules) | |
| Enum.map(mods, fn mod -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Clean the database | |
| DROP TABLE IF EXISTS _orders CASCADE; | |
| DROP TABLE IF EXISTS _users CASCADE; | |
| DROP TABLE IF EXISTS orders CASCADE; | |
| DROP TABLE IF EXISTS users CASCADE; | |
| # Build the database (for hard deletion) | |
| CREATE TABLE users ( | |
| id integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY, | |
| name text NOT NULL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The Problem: Marketing Team requires to crosscheck the list of products available | |
| # in all the websites of the Company | |
| # Input: A Excel File that contains "Model" and "Item Path" columns | |
| # Requirements: Models are duplicated, Remove the duplicated models and keep the Item Path | |
| # The problem: The cells in the "Model" columns contains extra spaces which makes all the models be unique | |
| # even if they are not | |
| # This script will remove extra spaces, remove the cells duplicated by keeping the first item found | |
| # author: Soraya Ruiz | |
| # date of creation: 27-08-2021 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Stick this in your home directory and point your Global Git config at it by running: | |
| # | |
| # $ git config --global core.attributesfile ~/.gitattributes | |
| # | |
| # See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details | |
| *.c diff=cpp | |
| *.h diff=cpp | |
| *.c++ diff=cpp | |
| *.h++ diff=cpp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(connection). | |
| -behaviour(gen_statem). | |
| -export([start_link/1, request/2]). | |
| -export([callback_mode/0, init/1]). | |
| -export([disconnected/3, connected/3]). | |
| %% Public API. | |
| start_link(Opts) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Add the following in .zshrc: | |
| ... | |
| plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl) | |
| ... | |
| ### Fix slowness of pastes with zsh-syntax-highlighting.zsh | |
| pasteinit() { | |
| OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]} | |
| zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Context + metadata | |
| shared_context 'Logged as a user', role: true do | |
| let(:user) { |example| create :user, example.metadata[:role] } | |
| before { login_as user } | |
| end | |
| scenario "Login as a client", role: :client | |
| scenario "Login as a customer", role: :customer | |
| scenario "Login as an admin", role: :admin |
Dear all Github friends,
I moved this gist to the Github repository.
Following this repository https://github.com/nijicha/install_nodejs_and_yarn_homebrew
NewerOlder