Instantly share code, notes, and snippets.

View unicorn
#!/bin/sh
# forked from https://gist.github.com/ethier/7190310
# via http://uncorruptedstate.com/blog/2013/10/27/zero-downtime-deployment-with-rails-and-unicorn/
### Unicorn variables ###
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/home/web/current
UNICORN=$APP_ROOT/bin/unicorn
TMP_PATH=$APP_ROOT/tmp
PID_PATH=$APP_ROOT/tmp/pids
View ask-wikipedia.rb
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
language = 'en'
article = ARGV[0] ||
begin
print 'What do you need to know? : '
URI::encode gets.chomp
View private.xml
<?xml version="1.0"?>
<root>
<appdef>
<appname>Terminal</appname>
<equal>com.apple.Terminal</equal>
<equal>iTerm</equal>
<equal>net.sourceforge.iTerm</equal>
<equal>com.googlecode.iterm2</equal>
</appdef>
<item>
View mousetrap-bind.js
/**
* Overwrites default Mousetrap.bind method to optionally accept
* an object to bind multiple key events in a single call
*
* You can pass it in like:
*
* Mousetrap.bind({
* 'a': function() { console.log('a'); },
* 'b': function() { console.log('b'); }
* });
View elasticsearch.rake
# Run with: rake environment elasticsearch:reindex
# Begins by creating the index using tire:import command. This will create the "official" index name, e.g. "person" each time.
# Then we rename it to, e.g. "person20121001" and alias "person" to it.
namespace :elasticsearch do
desc "re-index elasticsearch"
task :reindex => :environment do
klasses = [Place, Person, Caption]
View grunt-wat.js
// This was what I got, pasted into an email.
// v0.0.0.2 Robust version with namespacing
module.exports = function(grunt) {
//Grunt Globals
com.wtfjs.constants = new Array();
com.wtfjs.constants.ConcatOutputFileNameAndLocation="c:\\TestOutput.js";
com.wtfjs.constants.JavascriptDirectory = 'C:\\Work\\Patch29\\StaticContent\\RootAssets\\JsLib'
com.wtfjs.constants.MessageTaskStart = "StartingTask_";
com.wtfjs.constants.MessageTaskEnd = "EndingTask_";
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Sebastien P. https://twitter.com/#!/_sebastienp
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE