Skip to content

Instantly share code, notes, and snippets.

View jeroenvandijk's full-sized avatar

Jeroen van Dijk jeroenvandijk

View GitHub Profile

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

#!/bin/bash
###############################################
# To use:
# https://raw.github.com/gist/2776351/???
# chmod 777 install_postgresql.sh
# ./install_postgresql.sh
###############################################
echo "*****************************************"
echo " Installing PostgreSQL"
echo "*****************************************"
(ns cl-graph
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
;; Directed Acyclic Graphs
(defrel edge a b)
;; a
;; |
;; Copyright Jason Wolfe and Prismatic, 2013.
;; Licensed under the EPL, same license as Clojure
(use 'plumbing.core)
(require '[clojure.java.shell :as shell]
'[clojure.string :as str])
(import '[java.util HashSet] '[java.io File])
(defn double-quote [s] (str "\"" s "\""))
@jeroenvandijk
jeroenvandijk / Questions
Created September 6, 2011 10:43
GOTO Amsterdam
Day job: Software developer (mainly web)
What is your language of choice: Ruby
Open Source contributions: capybara-mechanize (self started), occasional contributions to Rails and many others projects
How do you use GitHub: As inspiration, as Git host for my open source projects and my company is using Git for private projects
@jeroenvandijk
jeroenvandijk / tired.rb
Created May 29, 2011 13:03 — forked from karmi/tired.rb
Template for generating a no-frills Rails application with support for ElasticSearch full-text search via the Tire gem
# ===================================================================================================================
# Template for generating a no-frills Rails application with support for ElasticSearch full-text search via Tire
# ===================================================================================================================
#
# This file creates a basic, fully working Rails application with support for ElasticSearch full-text search
# via the Tire gem [http://github.com/karmi/tire].
#
# You DON'T NEED ELASTICSEARCH INSTALLED, it is installed and launched automatically by this script.
#
# Requirements
#######################
#### DOCUMENTATION ####
#######################
#
# Run as:
#
# ruby phonegap-sc.rb APP_NAME
# ruby phonegap-sc.rb APP_NAME PROJECT_PATH
# ruby phonegap-sc.rb APP_NAME PROJECT_PATH OUTPUT_PATH
#
function cdgems() {
/usr/bin/osascript -e "tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down"
/usr/bin/osascript -e "tell application \"Terminal\" to do script with command \"cd $GEM_HOME/gems\" in window 1"
/usr/bin/osascript -e "tell application \"System Events\" to tell process \"Terminal\" to keystroke \"k\" using command down"
return 0
}
alias cdgems=cdgems
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
task :deploy => ['deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
task :migrations => [:push, :off, :migrate, :restart, :on, :tag]
task :rollback => [:off, :push_previous, :restart, :on]
task :push do
puts 'Deploying site to Heroku ...'
puts `git push heroku`
end