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
| sudo apt install git | |
| sudo apt install curl | |
| sudo apt install build-essential | |
| sudo apt install autoconf | |
| sudo apt install m4 | |
| sudo apt install libncurses5-dev | |
| sudo apt install libssh-dev | |
| sudo apt install unixodbc-dev | |
| git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3 |
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
| Application.put_env(:sample, PhoenixDemo.Endpoint, | |
| http: [ip: {127, 0, 0, 1}, port: 8080], | |
| server: true, | |
| live_view: [signing_salt: "bumblebee"], | |
| secret_key_base: String.duplicate("b", 64), | |
| pubsub_server: PhoenixDemo.PubSub | |
| ) | |
| Mix.install([ | |
| {:plug_cowboy, "~> 2.6"}, |
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
| Application.put_env(:sample, PhoenixDemo.Endpoint, | |
| http: [ip: {127, 0, 0, 1}, port: 8080], | |
| server: true, | |
| live_view: [signing_salt: "bumblebee"], | |
| secret_key_base: String.duplicate("b", 64), | |
| pubsub_server: PhoenixDemo.PubSub | |
| ) | |
| Mix.install([ | |
| {:plug_cowboy, "~> 2.6"}, |
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 Mlearning do | |
| @moduledoc false | |
| def mods(x) do | |
| [rem(x, 3), rem(x, 5)] | |
| end | |
| def fizzbuzz(n) do | |
| cond do | |
| rem(n, 15) == 0 -> [0, 0, 1, 0] |
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 Mlearning do | |
| @moduledoc false | |
| def mods(x) do | |
| [rem(x, 3), rem(x, 5)] | |
| end | |
| def fizzbuzz(n) do | |
| cond do | |
| rem(n, 15) == 0 -> [0, 0, 1, 0] |
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
| ##### phx live view 0.16 with leex | |
| def render(assigns) do | |
| ~L""" | |
| <button class="<%= if @foo && @bar && @baz do %>text-blue-600<% else %>text-red-600<% end %>">hello</button> | |
| """ | |
| end | |
| ##### phx live view 0.16 with heex -inline edition |
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
| // Code handling the card payment | |
| const payWithCard = function (stripe, card, clientSecret, liveView) { | |
| stripe | |
| .confirmCardPayment(clientSecret, { | |
| payment_method: { | |
| card: card, | |
| }, | |
| }) | |
| .then(function (result) { | |
| if (result.error) { |
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
| pip install jedi | |
| then -in your vimrc | |
| ``` | |
| nmap <Leader>j :call InvokeJumpToByType()<CR> | |
| function! InvokeJumpToByType() | |
| let filetype=&ft | |
| if filetype == 'python' | |
| exe ':call jedi#goto_definitions()' |
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
| 1) Install homebrew if you haven't already | |
| https://brew.sh/ | |
| 2) Install postgres | |
| brew install postgresql | |
| 3) Start the database |
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
| import { Promise } from 'rsvp'; | |
| import { next } from '@ember/runloop'; | |
| import { registerWaiter } from '@ember/test'; | |
| import { getContext } from '@ember/test-helpers'; | |
| export async function waitForRedux(key, value) { | |
| return new Promise(async (resolve) => { | |
| let counter = 1; | |
| registerWaiter(() => counter === 0); | |
| const { owner } = getContext(); |