Skip to content

Instantly share code, notes, and snippets.

T. Mjoen tmjoen

Block or report user

Report or block tmjoen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
# ssh to remote

localhost$ ssh -p 30000 my_app@diamond$ epmd -names
epmd: up and running on port 4369 with data:
name my_app at port 43108$ exit
tmjoen / webfonts.nginxconf
Created Nov 2, 2016
NGINX webfont protection from hotlinking
View webfonts.nginxconf
location ~ \.(eot|svg|ttf|woff|otf)$ {
valid_referers blocked *;
if ($invalid_referer) {
return 403;
View dynamic_dispatch.ex
# in your app supervisor
:phx_dyn_dispatch =, [:named_table, :bag, :public])
defmodule DynamicDispatch do
def register(group, plug, opts) do
true = :ets.insert(:phx_dyn_dispatch, {group, plug, opts})
def unregister(group, plug) do
~/sql ❯❯❯ createdb -T template0 db_name ⏎
~/sql ❯❯❯ pg_restore -C -d db_name db_name.custom
You can’t perform that action at this time.