Random timelines with a bit a shadow.
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
Time Traveling Industry Association of America | |
Life was good for a men who slipped in time all way back to late Roman empire. Money I gained by selling a scheme of a distiller I doubled on a cotton swabs and now I was plotting to introduce my naive romans to an idea of double-entry accounting and to a concept of zero. Until I suddenly heard a knocking at my door. | |
- Gai Julius also knows as Nicolas Kovalsky? - inquired a centurion at doorway. Golden gilding on his cuirass of stainless steel was chipped here and there and a plume of his helm definitely had a close relatives in a mop department of Superstore. | |
- You a time traveler, - I said cheerlessly, - Are you here to save me? | |
- I am a lawyer of Time Traveling Industry Association of America. |
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
[{lager, [ | |
{handlers, [ | |
{lager_console_backend, [ | |
debug, | |
{lager_default_formatter, [time, " ", {module, | |
[module, {line, [":", line], ""}], ""}, " ", color, message, {eol, "\e[0m\r\n"}]} | |
]}, | |
{lager_file_backend, | |
[{file, "logs/console.log"}, {level, info}, {size, 10485760}, {date, "$D0"}, {count, 1}]}, | |
{lager_file_backend, |
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
now_to_timestamp() -> | |
now_to_timestamp(erlang:now()). | |
now_to_timestamp({Mega, Sec, _}) -> | |
Mega * 1000000 + Sec. | |
timestamp_to_now(TS) -> | |
{TS div 1000000, TS rem 1000000, 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
uuid() -> | |
<<A:32, B:16, C:16, D:16, E:48>> = crypto:rand_bytes(16), | |
Fmt = "~8.16.0b-~4.16.0b-4~3.16.0b-~4.16.0b-~12.16.0b", | |
Str = io_lib:format(Fmt, [A, B, C band 16#0fff, D band 16#3fff bor 16#8000, E]), | |
list_to_binary(Str). |
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
join([], _) -> []; %% or should it be <<"">> for a consistency sake? | |
join([H|[]], _) -> H; | |
join(List, Sep) when is_list(Sep) -> | |
join(List, list_to_binary(Sep)); | |
join([H|T], Sep) -> | |
join(T, H, Sep). | |
join([], Acc, _) -> | |
Acc; | |
join([H|T], Acc, Sep) -> |
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
#!/usr/bin/env escript | |
%% -*- erlang -*- | |
%%! -hidden -setcookie cookie | |
-mode(compile). | |
main(["-?"]) -> | |
usage(); | |
main(Args) -> | |
case get_pid(Args) of |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer