Skip to content

Instantly share code, notes, and snippets.

View mrrooijen's full-sized avatar

Michael van Rooijen mrrooijen

View GitHub Profile
@mrrooijen
mrrooijen / countries.js
Last active May 27, 2016 13:27
A list of country codes and names
COUNTRIES = {
"US": "United States",
"AF": "Afghanistan",
"AX": "Åland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
@mrrooijen
mrrooijen / gitlab_backup
Last active May 27, 2016 13:25
Generates, encrypts, transfers and rotates Gitlab backups to/on Amazon S3.
#! /bin/bash
# Generates, encrypts, transfers and rotates Gitlab backups to/on Amazon S3.
# Requirements:
#
# 1. Gitlab
#
# $ apt-get update
@mrrooijen
mrrooijen / cmd.sh
Created April 21, 2016 15:11
Destroy File Vault Key when going to standby mode. Enter standby immediately on sleep.
sudo pmset -a destroyfvkeyonstandby 1 hibernatemode 25
@mrrooijen
mrrooijen / heroku_pg_backup
Last active April 18, 2016 13:17
Fetches, encrypts, transfers and rotates Heroku Postgres backups to/on Amazon S3.
#! /bin/bash
# Fetches, encrypts, transfers and rotates Heroku Postgres backups to/on Amazon S3.
# Requirements:
#
# 1. Heroku Toolbelt
#
# $ wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
@mrrooijen
mrrooijen / deploy.rb
Created June 26, 2011 02:37
Capistrano with Foreman Capfile
# encoding: utf-8
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require 'rvm/capistrano'
set :application, "hirefireapp"
set :repository, "git@codeplane.com:meskyanichi/myapp.git"
set :branch, "develop"
set :rvm_ruby_string, "1.9.2"
@mrrooijen
mrrooijen / rbenvsudo.sh
Created April 3, 2012 10:29
A little shell function that allows you to perform rbenv (gem) commands with sudo privileges. Similar to rvmsudo.
function rbenvsudo(){
executable=$1
shift 1
sudo $(rbenv which $executable) $*
}
@mrrooijen
mrrooijen / RedditHomePage.elm
Created January 22, 2016 20:16 — forked from TheSeamau5/RedditHomePage.elm
Getting the Reddit Home Page using Elm Promises
--------------------------
-- CORE LIBRARY IMPORTS --
--------------------------
import Task exposing (Task, succeed, andThen, onError)
import Json.Decode exposing (Decoder, object2, (:=), string, int, list, map)
import Signal exposing (Signal, Mailbox, mailbox, send)
import List
---------------------------------
-- THIRD PARTY LIBRARY IMPORTS --
@mrrooijen
mrrooijen / artistSearchExample.elm
Created January 22, 2016 20:16 — forked from TheSeamau5/artistSearchExample.elm
Artist Search Example
--------------------------
-- CORE LIBRARY IMPORTS --
--------------------------
import Json.Decode as Decode exposing (Decoder, object2, map, string, list, (:=))
import Task exposing (Task, andThen, succeed, fail, onError)
import Signal exposing (Signal, Mailbox, mailbox, message, send)
import String
-------------------------
@mrrooijen
mrrooijen / HackerNewsExample.elm
Created January 22, 2016 20:16 — forked from TheSeamau5/HackerNewsExample.elm
Hacker news requests example
--------------------------
-- CORE LIBRARY IMPORTS --
--------------------------
import Task exposing (Task, ThreadID, andThen, sequence, succeed, spawn)
import Json.Decode exposing (Decoder, list, int, string, (:=), map, object2)
import Signal exposing (Signal, Mailbox, mailbox, send)
import List
---------------------------------
-- THIRD PARTY LIBRARY IMPORTS --
@mrrooijen
mrrooijen / hdiutil.sh
Last active January 2, 2016 22:59
Set of commands for creating OSX Journaled (Extended) Encrypted images. Attaching them. Detaching them. Attaching them on system boot.
# Create a 10 megabytes, blank, AES 256 Encrypted, with password "mypassword",
# MacOS Journaled (Extended) image named "MyImage" when attached,
# and myimage.dmg as filename in the current directory.
#
echo -n "mypassword" | hdiutil create \
-encryption AES-256 \
-stdinpass \
-size 10m \
-fs "Journaled HFS+" \
-volname MyImage \