Skip to content

Instantly share code, notes, and snippets.

@jswny
jswny / Flexible Dockerized Phoenix Deployments.md
Last active July 3, 2023 05:25
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

@jamesduncombe
jamesduncombe / amnesia.sh
Last active September 16, 2020 01:08
Amnesia.io bash alias
amn() {
if [ $# -ge 1 -a ! -f $1 ]; then
input=$(cat -)
temp=$(mktemp)
echo $input > $temp
curl -sF "file=@$temp;filename=xyz.$1" https://amnesia.io
rm $temp
elif [ $# -ge 1 -a -f $1 ]; then
curl -sF "file=@$1" https://amnesia.io
else
@Arinerron
Arinerron / permissions.txt
Last active June 23, 2024 19:34
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
@FernandoDoming
FernandoDoming / pry.py
Created September 8, 2016 12:02
Python's binding pry equivalent
import code; code.interact(local=dict(globals(), **locals()))
@hyle
hyle / ko.utils.3.4.0.signatures.js
Last active September 25, 2018 09:12
KnockoutJS 3.4.0 / 3.4.1 / 3.4.2 utils (ko.utils) signatures
// knockout 3.4.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@hisapy
hisapy / hash_to_xml_example.rb
Created May 8, 2015 16:32
Create XML from Hash recursively using Nokogiri
hash_tree = {} # hash where all the members are also hashes, even the "leaf nodes"
def xml_node(node, children, xml)
xml.send(node){
children.each do | n, c |
xml_node(n, c, xml)
end
}
end
builder = Nokogiri::XML::Builder.new do | xml |
@pankajp
pankajp / serve_http.py
Last active February 5, 2024 17:51
Simple Python HTTP Server with multi-threading and partial-content support
#! /usr/bin/env python
# Standard library imports.
from SocketServer import ThreadingMixIn
import BaseHTTPServer
import SimpleHTTPServer
import sys
import json
import os
from os.path import (join, exists, dirname, abspath, isabs, sep, walk, splitext,
@DanAntFerrari
DanAntFerrari / share.html
Last active March 9, 2016 15:57
Social links share
<ul class="social">
<li>
<a title="Pinterest" href="//www.pinterest.com/pin/create/button/?url=http://www.YOURSITE.com/cat-{{ post.id_post }}"
target="_blank"
rel="nofollow"
onclick="window.open(this.href,'_blank', 'width=700, height=300');return false;">
<span class="icon icon-pinterest"></span>
</a>
</li>
<li>
@BlackMac
BlackMac / ctags_autocomplete.py
Created February 14, 2012 09:48
autocomplete over project for Sublime Text 2
# CTags based autocompletion plugin for Sublime Text 2
# You can add the file to the User Package in ~/Library/Application Support/Sublime Text 2/Packages and restart Sublime Text 2.
# generate the .tags file in your project root with "ctags -R -f .tags"
import sublime, sublime_plugin, os
class AutocompleteAll(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
tags_path = view.window().folders()[0]+"/.tags"
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt