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 benchmark(f, args \\ [], min_duration \\ @default_duration) | |
def benchmark(f, args, min_duration) when is_list(f) and is_list(args) do | |
Enum.map(f, fn(fp) -> benchmark(fp, args, min_duration) end) | |
end | |
def benchmark(f, args, min_duration) when is_function(f) do | |
IO.inspect fp | |
results = do_benchmark(fp, args, min_duration) | |
IO.puts results | |
results | |
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
defmodule Instrument do | |
@zero :decimal_conv.number("0") | |
@struct symbol: nil, name: "", value: @zero | |
defstruct @struct | |
@keys Enum.sort(@struct |> Map.keys |> List.delete(:__struct__)) | |
for k <- @keys do | |
def __atomize__({unquote(Atom.to_string(k)), v}, acc) do | |
Dict.put(acc, unquote(k), v) | |
end | |
def __atomize__({unquote(k), v}, acc) do |
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
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 |
OlderNewer