Skip to content

Instantly share code, notes, and snippets.

View gist:2936374
# bash/zsh completion support for core Git.
# Copyright (C) 2006,2007 Shawn O. Pearce <>
# Conceptually based on gitcompletion (
# Distributed under the GNU General Public License, version 2.0.
# The contained completion routines provide support for completing:
Funfun / index.html
Created Jun 29, 2012
nvd3 tooltip tests
View index.html
<meta charset="utf-8">
<link href="" rel="stylesheet" type="text/css"/>
body {
Funfun / gist:3047383
Created Jul 4, 2012
cake with minify and coffee watcher
View gist:3047383
fs = require 'fs'
{print} = require 'sys'
{exec} = require 'child_process'
{spawn} = require 'child_process'
option '-o', '--output [DIR]', 'output dir'
task 'minify', 'Minify mongo production scripts', ->
exec 'uglifyjs --overwrite lib/mongo/lib/*.js', (err, stdout, stderr) ->
Funfun / gist:3052150
Created Jul 5, 2012
sum of elems in array
View gist:3052150
total = 0
$.each arr, ->
total += this
View index.html
#stats{style: "height: 500px;"}
View gist:3877724

Don't use MongoDB

I've kept quiet for awhile for various political reasons, but I now feel a kind of social responsibility to deter people from banking their business on MongoDB.

Our team did serious load on MongoDB on a large (10s of millions of users, high profile company) userbase, expecting, from early good experiences, that the long-term scalability benefits touted by 10gen

View xml_helper.rb
module Alfabank
module XmlHelper
class <<self
def tag(name, value, attribues = {})
attrs ={|n, v| "#{n}=\"#{v}\""}.join(' ')
"<#{name} #{attrs}>#{value}</#{name}>"
View database.yml.example mysql2
# MySQL. Versions 4.1 and 5.0 are recommended.
# Install the MySQL driver:
# gem install mysql2
# And be sure to use new-style password hashing:
adapter: mysql2
encoding: utf8

This variation of a simple bar chart adds sorting with staggered delay and translucency to improve readability during the transition. This technique is recommended by Heer & Robertson. Use the checkbox in the top right to turn sorting on or off.

Funfun / gist:5046400
Created Feb 27, 2013
some sort of examples 'how to use threads
View gist:5046400
require 'thread'
require 'net/http'
urls = ["", "", ""]
threads = []
responses = []
responses_mutex =
urls.each do |url|