Skip to content

Instantly share code, notes, and snippets.

View helderalvescouto's full-sized avatar

Helder Alves Couto helderalvescouto

  • Brasil
View GitHub Profile
@helderalvescouto
helderalvescouto / mac-setup-redis.md
Created December 27, 2021 11:04 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
--> Alteração migration de contact
use Ecto.Migration
def change do
alter table(:contacts) do
add :custom_fields, {:array, :map}, default: []
end
end
--> Esquema de contact
<h1> Test </h1>
@helderalvescouto
helderalvescouto / campaign(show.ex)
Created July 21, 2021 00:33
renderizar html de um liveview filho em um live pai
onde preciso chamar
@impl true
def mount(params, session, socket) do
socket =
socket
|> assign(
:campaign_pause_disposition,
CampaignPauseDispositions.campaign_list_pause_dispositions()
)
|> assign(
@helderalvescouto
helderalvescouto / gist:f646efe7aabc67f5ac8c3de812d83cb0
Created June 2, 2021 16:00
Inserir dados em um schema com campos somente de belongs_to
Schema:
schema "campaign_pause_disposition_assigns" do
belongs_to :pause_disposition, Dispositions.PauseDisposition, type: :binary_id
belongs_to :campaign_list_pause_disposition, CampaignPauseDispositions.CampaignListPauseDisposition, type: :binary_id
timestamps()
end
@required_fields ~w(pause_disposition_id campaign_list_pause_disposition_id)a
@helderalvescouto
helderalvescouto / asterisk.sh
Created January 22, 2021 12:04 — forked from kolosek/asterisk.sh
Install Asterisk 16 LTS on Ubuntu 18.04 / 16.04 & Debian 10/9
#Update system & reboot
sudo apt update && sudo apt -y upgrade
sudo reboot
#Install Asterisk 16 LTS dependencies
sudo apt -y install git curl wget libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev build-essential libjansson-dev libxml2-dev uuid-dev
#Add universe repository and install subversio
sudo add-apt-repository universe
sudo apt update && sudo apt -y install subversion