Skip to content

Instantly share code, notes, and snippets.

View gist:4e79a78bb31453742d6171111aa07b6d
Install RabbitMQ:
git clone
cd rabbitmq-server
git checkout rabbitmq_v3_6_11 # or whatever tag
make run-broker
Install CouchDB:
git clone
cd couchdb

Keybase proof

I hereby claim:

  • I am jamesaimonetti on github.
  • I am mc_ ( on keybase.
  • I have a public key ASC5GcszH-iX5Yyvew26nqlt5-fHw7fUKbr6xVTds9zSfQo

To claim this, I am signing this object:

View gist:371f1d81302e242670a847f875ddd7cf

Symmetric Encryption

The only way to encrypt today is authenticated encryption, or "AEAD". ChaCha20-Poly1305 is faster in software than AES-GCM. AES-GCM will be faster than ChaCha20-Poly1305 with AES-NI. Poly1305 is also easier than GCM for library designers to implement safely. AES-GCM is the industry standard.

Use, in order of preference:

  1. The NaCl/libsodium default
View *scratch*.el
james@pdx:~/local/git/2600hz/kazoo$ ./scripts/dialyze-changed.bash core/kazoo_amqp/ebin/gen_listener.beam core/kazoo_number_manager/ebin/ core/kazoo_json/ebin/ core/kazoo_web/ebin/ core/kazoo_data/ebin/
dialyzing changed files:
Checking whether the PLT .kazoo.plt is up-to-date... yes
Compiling some key modules to native code... done in 0m0.36s
Proceeding with analysis...
knm_carriers.erl:302: The pattern <Number, 'undefined', _DryRun> can never match the type <knm_number:knm_number(),<<_:8,_:_*8>>,boolean()>
knm_carriers.erl:445: The call knm_number:phone_number(Number::<<_:8,_:_*8>>) does not have an opaque term of type knm_number:knm_number() as 1st argument
knm_inum.erl:63: The test <<_:8,_:_*8>> =:= 'undefined' can never evaluate to 'true'
knm_inum.erl:64: The pattern 'true' can never match the type 'false'
knm_local.erl:83: Invalid type specification for function knm_local:find_more/6. The success typing is (<<_:40,_:_*8>>,pos_integer(),non_neg_integer(),<<_:8,_:_*8>>,non_neg_integer(),[knm_number
View dialyzer
james@pdx:~/local/git/2600hz/kazoo$ dialyzer --plt .kazoo.plt applications/crossbar/ebin/cb_tasks.beam applications/tasks/ebin/kz_tasks_help.beam applications/tasks/ebin/kz_tasks_scheduler.beam applications/tasks/ebin/kt_numbers.beam applications/tasks/ebin/kt_services.beam applications/tasks/ebin/kt_skel.beam core/kazoo_tasks/ebin/kz_csv.beam core/kazoo_tasks/ebin/kz_tasks.beam applications/crossbar/ebin/cb_context.beam applications/crossbar/ebin/crossbar_bindings.beam applications/crossbar/ebin/crossbar_doc.beam applications/crossbar/ebin/crossbar_util.beam core/kazoo/ebin/kapi_tasks.beam core/kazoo_config/ebin/kapps_config.beam core/kazoo_apps/ebin/kapps_util.beam core/kazoo_number_manager/ebin/knm_errors.beam core/kazoo_number_manager/ebin/knm_number.beam core/kazoo_number_manager/ebin/knm_phone_number.beam core/kazoo_number_manager/ebin/knm_util.beam core/kazoo_documents/ebin/kz_account.beam core/kazoo_amqp/ebin/kz_amqp_worker.beam core/kazoo/ebin/kz_api.beam core/kazoo_data/ebin/kz_datamgr.beam core/ka
jamesaimonetti / gist:62d7267d0265d6eabe12
Last active August 29, 2015 14:18
Modify normalize_media
View gist:62d7267d0265d6eabe12
Modified core/whistle_media-1.0.0/src/wh_media_util.erl
diff --git a/core/whistle_media-1.0.0/src/wh_media_util.erl b/core/whistle_media-1.0.0/src/wh_media_util.erl
index 197c285..91ab714 100644
--- a/core/whistle_media-1.0.0/src/wh_media_util.erl
+++ b/core/whistle_media-1.0.0/src/wh_media_util.erl
@@ -41,14 +41,24 @@
{'error', ne_binary()}.
-spec normalize_media(ne_binary(), ne_binary(), binary()) ->
+-spec normalize_media(ne_binary(), ne_binary(), binary(), wh_proplist()) ->
jamesaimonetti / gist:d3cfa1bf3d4e7809c433
Created May 23, 2014 21:21
Pagination Docs Snippet
View gist:d3cfa1bf3d4e7809c433


Select APIs support pagination, the ability to return a subset of the results, with a key to the next set of results. Currently, only the following APIs have pagination enabled:

  • Accounts
  • CDRs

Let's take a look at the CDRs API to see how to interpret pagination.

CDR Pagination

View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
View gist:496024
{sys, [
{lib_dirs, ["../deps", "../.."]}
,{rel, "myapp", "1.0",
View gist:495896
{sys, [
{lib_dirs, ["/home/james/local/git/", "../.."]},
{rel, "myapp", "1",