If .DS_Store was never added to your git repository, simply add it to your .gitignore file.
.gitignore
In your the root directory of your app and simply write
FROM elixir:latest | |
# Install debian packages | |
RUN apt-get update && \ | |
apt-get install --yes build-essential inotify-tools postgresql-client git && \ | |
apt-get clean | |
ADD . /app | |
# Install Phoenix packages |
deposit_query = from(BankAccount, where: [id: 2]) #deposit target bank account | |
withdraw_query = from(BankAccount, where: [id: 1]) #withdraw from bank account | |
deposit_update = [inc: [balance: 100]] | |
withdraw_update = [inc: [balance: -100] | |
alias Ecto.Multi | |
# iex> h Ecto.Multi # Multi.new() creates a one-time op that atomically groups transactions | |
# iex> h Ecto.Multi.update_all # def update_all(multi, name, queryable_or_fun, updates, opts \\ []) |
# genserver with registry | |
defmodule MyApp.Workers.ShoppingCartCache do | |
use GenServer | |
require Logger | |
# one month | |
@ttl System.get_env("SHOPPING_CART_CACHE_PUBLIC_TTL") |> String.to_integer() | |
def start_link(shopping_cart_id) do | |
GenServer.start_link(__MODULE__, [shopping_cart_id], name: via_tuple(shopping_cart_id)) |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/> | |
</head> | |
<body> | |
<div id="phx_root"> |
/* to add to assets/css/app.css */ | |
.thumb-selected { | |
border: 4px solid #0069d9; | |
} | |
.thumb-unselected { | |
opacity: 0.5; | |
} |
##### 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 |
Note: this assumes you are using ZSH shell.
Install asdf:
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0
$ echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
People
![]() :bowtie: |
π :smile: |
π :laughing: |
---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
You are given a set of bars of gold and your goal is to take as much gold as possible into your bag. There is just one copy of each bar and for each bar you can either take it or not (hence you cannot take a fraction of a bar).
Given π gold bars, find the maximum weight of gold that fits into a bag of capacity π.
The first line of the input contains the capacity π of a knapsack and the number π of bars