Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# Evaluates a sample of keys/values from each redis database, computing statistics for each key pattern:
# keys: number of keys matching the given pattern
# size: approximation of the associated memory occupied (based on size/length of value)
# percent: the proportion of this 'size' relative to the sample's total
#
# Copyright Weplay, Inc. 2010. Available for use under the MIT license.
½ cup light brown sugar
¼ cup sweet paprika
1 tbsp. chili powder
1 tbsp. onion powder
1 tbsp. garlic powder
1 tbsp. cayenne
apple cider (farmer's market)
3 lemons
Shichimi togarashi
crème fraîche
@quirkey
quirkey / emoji.m
Created August 16, 2012 15:48 — forked from javan/emoji.m
Campfire Emoji
sDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:
// People
@":smile:", @"\ue415",
@":blush:", @"\ue056",
@":smiley:", @"\ue057",
@":relaxed:", @"\ue414",
@":smirk:", @"\ue402",
@":heart_eyes:", @"\ue106",
@":kissing_heart:", @"\ue418",
//
// goal: load in data, then template
//
var nav = $.sammy('#mainNav',function(){
this.use(Sammy.Mustache,'ms');
this.get('#/', function() {
this.load('data/nav.json')
.render('templates/nav.ms') // render will take the previous data as the `data` arg for rendering
.swap();
@quirkey
quirkey / nicer.rb
Created November 1, 2010 00:12 — forked from mrb/nicer.rb
class Engine
include Achievements::AchievementsEngine
achievements do
:context1 do
achieve {:name => :one_time, :threshold => 1}
end
:context2 do
achieve {:name => :one_time, :threshold => 1}
[vhosts]
swinger.iodyne.net = /swinger/_design/swinger/_rewrite
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
# 9 workers and 1 master
worker_processes 9
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
# Restart any workers that haven't responded in 30 seconds
timeout 30
(function( $ ) {
$.event.special.hashchange = {
setup: function( data, namespaces) {
if ( 'onhashchange' in window ) {
// sweet, native support... short-circuit
return false;
}
// onhashchange is not natively supported ... work around it :(
fakeHashChange();
},
;(function($) {
$.fn.soon = function(what, when) {
var $this, args;
if (typeof when == "undefined") when = 5000;
args = $.makeArray(arguments).slice(2);
$this = $(this);
setTimeout(function() {
$this[what].apply($this,args);
}, when);
return $this;