Skip to content

Instantly share code, notes, and snippets.

View gist:9a83af688d4d65c9ba4c7704f240c9c3
12> compile:file("test.erl", [nowarn_export_all,warnings_as_errors,{outdir, "."}]).
{ok,test}
13> beam_lib:chunks("test.beam", [compile_info]).
{ok,{test,[{compile_info,[{options,[nowarn_export_all]},
{version,"7.1"},
{source,"/home/tristan/Devel/vonnegut/test.erl"}]}]}}
View gist:6c833ee00b7669dfa310917f513a4f69
> compile:file("test.erl", [nowarn_export_all,warnings_as_errors]).
{ok,test}
> beam_lib:chunks("test.beam", [compile_info]).
{ok,{test,[{compile_info,[{options,[nowarn_export_all]},
{version,"7.1"},
{source,"/home/tristan/Devel/vonnegut/test.erl"}]}]}}
View .erlang
%% ~/.erlang runs too late to effect the regular `erl` shell
%% but will result in `rebar3 shell` using `.rebar3/` for history
application:set_env(kernel, shell_history, enabled).
application:set_env(kernel, shell_history_path, ".rebar3").
View prettypr.md

Exports given by prettypr:

-export([block_fragment/1, format/1, new/2,
     promised_stream_id/1, read_binary/2, to_binary/1,
     to_frame/4]).

becomes

View gist:d0a035956836cb488ae71f4942085c5e
signature <<"7f7a6b9d538e1ecec4a9c9bb1680b074b8a5348a45398445f38943dbb143617ddb66df4e505e9bbc8eef75de4d1621463358a81bc699975f61514da13fb12fcde3d82e5b849dada58405a123e1988776e04f535598bf20868042f328f93166b077114e86a9cf4c73b08b2e76b689f2828865fbd25af41c56e22caccd4d7e7d9b0f03b02001a5b9f39fc328f9afb5c9b45da8447ef79fe6f3425b5d716fd0bb3b6c34ddb97934c11ab35963cb3a74fd080a4d944b049da37ad0271fa02aa814d599110bb0af76b64d121052ecf3011c9f6c13fba30e323020e992d596917395c320ee01505a14c8138aa6c58eba80ca9ff09ee06ba4f3803cc1c87e80f39b3615">>
key {'RSAPublicKey',2103656186816426464993556206589111958056075894398729511101995302874238480403340092592121959263220416662739875673467702811200467754813898662686868405148362442960944306793709578482356491108531022965489887106091509759178338067185313780570855593455147124474536498547378447079959944465118270307701218020100430546289604281386243108482839869300393703941544734307761762030516493824969319740500745997315064697736981745163387435715739016977771518090331906285215620944972761770834310144
View gist:4fd5d7c0555dcb816e5d8273e70375a8
{ok, {{_, 200, _}, _, Signature}} = httpc:request(get, {Url, [{"User-Agent", rebar_utils:user_agent()}]}, [], [{sync, true}], rebar),
{ok, Data} = file:read_file(TmpFile),
[RsaPublicKey] = public_key:pem_decode(?PUBLIC_KEY),
Key = public_key:pem_entry_decode(RsaPublicKey),
public_key:verify(Data, sha512, Signature, Key)
View gist:5d02bbe41c6a1f0aadf55642fc20de88
### Keybase proof
I hereby claim:
* I am tsloughter on github.
* I am tsloughter (https://keybase.io/tsloughter) on keybase.
* I have a public key whose fingerprint is 7C9E EE1C CC28 58E1 CC8E B9BA C702 BA41 86F9 3DCF
To claim this, I am signing this object:
@tsloughter
tsloughter / e.md
Last active Nov 4, 2016
Erlang/OTP libraries/modules replaced by third party projects
View e.md

I'm looking to collect information on why certain functionality found in Erlang/OTP is usually handled instead by a third party library in people's projects.

This could be bugs, missing functionality, poor interface, performance, etc.

Examples off the top of my head that need expanding on are:

  • httpc
  • httpd
  • http_uri
View ct.md

Install makeself:

apt-get install makeself

or

brew install makeself
View gist:4646f11aaf19ba6547d4
{profiles, [{test,
{erl_opts, [{src_dirs, ["src", "test"]}]}
]}]}.