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
View remote_observer.md
# ssh to remote

localhost$ ssh -p 30000 my_app@diamond

my_app@my_app.com$ epmd -names
epmd: up and running on port 4369 with data:
name my_app at port 43108
my_app@my_app.com$ exit
@tmjoen
tmjoen / webfonts.nginxconf
Created Nov 2, 2016
NGINX webfont protection from hotlinking
View webfonts.nginxconf
location ~ \.(eot|svg|ttf|woff|otf)$ {
valid_referers blocked mysite.com *.mysite.com;
if ($invalid_referer) {
return 403;
}
}
View dynamic_dispatch.ex
# in your app supervisor
:phx_dyn_dispatch = :ets.new(: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})
end
def unregister(group, plug) do
View pg_restore.sh
~/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.