Skip to content

Instantly share code, notes, and snippets.

@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 19, 2025 17:31 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@tobyhede
tobyhede / postsql.sql
Created May 17, 2012 03:08
PostgreSQL as JSON Document Store
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@masterkain
masterkain / Gemfile
Created March 1, 2012 03:29
Sidekiq GitHub issue reporter
gem 'sidekiq'
gem 'octokit'
@mchung
mchung / gist:1625690
Created January 17, 2012 08:41
Migrating data from Postgres 8.3 to Postgres 9.1 on Heroku
project $ heroku db:pull
Loaded Taps v0.3.23
Auto-detected local database: postgres://[email protected]/pg91-dev?encoding=utf8
Warning: Data in the database 'postgres://[email protected]/pg91-dev?encoding=utf8' will be overwritten and will not be recoverable.
[snip]
project $ heroku pg:promote HEROKU_SHARED_POSTGRESQL_PURPLE
project $ heroku db:push
anonymous
anonymous / merger.py
Created November 2, 2011 18:40
import inspect
import operator
#
# Core mechanic
#
def merge_from_ancestors(self, attribute):
"""
@wickedchicken
wickedchicken / app.rb
Created October 6, 2011 01:03
Sample Sinatra app to periodically submit hit data to metrics
# example code to submit data to the Librato Metrics API
# this is a small sinatra web application that keeps track of how many times
# the main page has been hit. when desired, the user can submit that data to metrics
# for more info visit http://dev.librato.com/
# 1.8.x compatibility
require 'rubygems'
@javan
javan / gist:1168475
Created August 24, 2011 16:32
Fix iPhone home button
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/
1.) Open any application
2.) Press and hold the power button until the slide to shutdown swipe bar appears.
3.) Release Power button
4.) Press and hold Home button Lightly
until screen returns to icon screen
@evilchili
evilchili / chili.vom
Created August 2, 2011 00:38
vim colorscheme (xterm)
" Vim color file for xterm-256color
"
" Name: chili.vim
" Maintainer: Greg Boyington <[email protected]>
"
" Adapted from:
" Name: inkpot.vim
" Maintainer: Ciaran McCreesh <[email protected]>
" Homepage: http://github.com/ciaranm/inkpot/
"