This file contains 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
cat data/data/com.termux/files/home/.bash_profile | |
if [ -d "$HOME/bin" ] ; then | |
PATH="$HOME/bin:$PATH" | |
fi | |
export SVDIR="$HOME/etc/sv" | |
mkdir -p $PREFIX/var/run | |
mkdir -p ~/.log | |
daemonize -c $PREFIX -l $PREFIX/var/run/runsvdir.lock -p $PREFIX/var/run/runsvdir.pid $PREFIX/bin/applets/runsvdir $SVDIR 2>/dev/null||: |
This file contains 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
cat etc/Caddyfile | |
# entrypoint for accessing from PC | |
phone.local:8080 { | |
tls /data/data/com.termux/files/home/etc/phone.crt /data/data/com.termux/files/home/etc/phone.key | |
basicauth /wiki "username" password | |
proxy /wiki 127.0.0.1:8090 { | |
websocket | |
} | |
} | |
# entrypoint for accessing locally from phone |
This file contains 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
cat priv/spec/db.yml | |
swagger: '2.0' | |
info: | |
title: CouchDB API | |
description: CouchDB API to define bindings | |
version: "2.0" | |
# the domain of the service | |
host: couchdb.org | |
# array of all schemes that your API supports | |
schemes: |
This file contains 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
$ mix | |
==> common | |
Compiled lib/classes.ex | |
Generated common.app | |
==> macro | |
Compiled lib/method.ex | |
Generated macro.app | |
$ touch apps/common/lib/classes.ex | |
$ mix | |
==> common |
This file contains 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
def project do | |
your_options = [] | |
[ | |
... | |
elixirc_options: your_options ++ options(Mix.env) | |
] | |
end | |
defp options(env) when env in [:dev, :test] do | |
[exlager_level: 7] |
This file contains 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
#!/usr/bin/env elixir | |
defmodule DSL do | |
defmacro action(match, [do: body]) do | |
quote do | |
def handle_info(unquote(match) = arg, state) do | |
unquote(body) | |
{:ok, state} | |
end | |
end | |
end |
This file contains 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
'/Users/some_user/dev/myproject/apps/myapp/ebin', | |
'/Users/some_user/dev/myproject/apps/myapp/deps/gen_leader/ebin', | |
'/Users/some_user/dev/myproject/apps/myapp/deps/edown/ebin', | |
'/Users/some_user/dev/myproject/apps/myapp/deps/gproc/ebin', | |
'/Users/some_user/dev/myproject/apps/myapp/deps/genx/ebin', | |
'.', | |
'/usr/local/dev/erlang/R15B02/lib/erlang/lib/kernel-2.15.2/ebin', | |
'/usr/local/dev/erlang/R15B02/lib/erlang/lib/stdlib-1.18.2/ebin', | |
'/Users/some_user/dev/myproject/deps/elixir/bin/../lib/mix/ebin', | |
'/Users/some_user/dev/myproject/deps/elixir/bin/../lib/iex/ebin', |
This file contains 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
delegate [ | |
capabilities(_self), | |
delete(_self), | |
url(_self), url(url, _self), | |
forward(_self), back(_self), | |
], | |
to: :htse_session, with: _pid |
This file contains 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
defmacrop _pid(args) do | |
[_self|rest] = Enum.reverse(args) | |
session_pid = quote do: unquote(_self).session_pid | |
element = quote do: unquote(_self).element | |
[session_pid,element|Enum.reverse(rest)] | |
end | |
delegate [element(strategy, value, _self)], | |
to: :htse_session, as: :element_element, with: _pid |
This file contains 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
``` | |
Performance: | |
| asymptotic | length | | |
| | 10 | 100 | 1000 | 10000 | | |
| |min med max avg|min med max avg|min med max avg|min med max avg| | |
cons | | 0, 0, 537, 0 | 0, 0, 572, 0 | 0, 0, 223, 0 | 0, 0, 431, 0 | | |
drop | | 0, 0, 204, 0 | 0, 1, 356, 1 | 1, 1, 204, 1 | 1, 1, 450, 2 | | |
drop_tail | | 2, 3, 393, 3 | 1, 2, 588, 2 |294,302,501,306|2627,2768,9390,2812| | |
drop_tail_r| | 1, 2, 588, 2 | 16,17,404,17 |156,165,385,167|1364,1486,3650,1498| | |
from_list_r| | 0, 1, 405, 1 | 9,10,519,10 |112,114,879,116| 996,1037,3104,1060| |
NewerOlder