Today I'll cover three basic topics:
-
Mistakes and misuses every Erlanger does when he starts to write in Elixir
-
Dependencies and Mix
-
Writing OTP-enabled Elixir applications
if [ "`git rev-parse --show-cdup`" != "" ]; then cd `git rev-parse --show-cdup`; fi && pwd |
def lz(number, symbols=90, arity=2) | |
unpadded = number.to_s arity | |
padded = '0' * (symbols - unpadded.length) + unpadded | |
end |
16:21 < dobby156> I think if you want here to get into prog, you | |
don't need 40th anniversary boxset you need a | |
big bag of buds and maybe some LSD | |
16:21 < MagBo> a-a-a-a-and that goes straight to my quote | |
database! |
#!/bin/bash | |
GITHUB_RO_DIRECTORY="$HOME/github/others" | |
BIN_DIRECTORY="/usr/local/bin" | |
GITHUB_URL="git://github.com/elixir-lang/elixir.git" | |
mkdir -p $GITHUB_RO_DIRECTORY > /dev/null | |
mkdir -p $BIN_DIRECTORY > /dev/null | |
cd $GITHUB_RO_DIRECTORY | |
[[ ! -d ./elixir ]] && git clone $GITHUB_URL |
-- Standard awesome library | |
local gears = require("gears") | |
local awful = require("awful") | |
awful.rules = require("awful.rules") | |
require("awful.autofocus") | |
-- Widget and layout library | |
local wibox = require("wibox") | |
-- Theme handling library | |
local beautiful = require("beautiful") | |
-- Notification library |
for pfx in {"","_development","_production","_test"} | |
do mysqldump -u root -p'123qwezzz' redmine2${pfx} | gzip > /tmp/redmine2${pfx}.dump.gz | |
done |
I have finally decided to start "Elixir newbie digest" and put here stuff that would be nice for me to understand before I have started my first Elixir production project.
Some of those will be hints, some of those will be in depth analysis of how Elixir language deals with stuff, but I plan to focus on the very basic things and keep those digests as much practical as possible.
Don't know whether those digests will be periodic, but I sincerely hope so.
iex(14)> f = function do | |
...(14)> (do: anything) -> anything | |
...(14)> (_) -> :nothing | |
...(14)> end | |
#Fun<erl_eval.6.82930912> | |
iex(15)> f.(do: 42) | |
42 | |
iex(16)> f.(do | |
...(16)> answer = 42 | |
...(16)> answer |
y = fn(f) -> | |
g = fn(g) -> f.((g.(g)).(&1)) end | |
g.(g) | |
end |