Skip to content

Instantly share code, notes, and snippets.

# ...
populateAutocompleteForResourceName = (resourceName, done) ->
redisClient = require("redis").createClient()
redisClient.debug_mode = true
sequelize = require('./app/models').sequelize
redisKey = "compl:#{resourceName}"
selectQuery = "SELECT DISTINCT(\"Places\".\"#{resourceName}\") from \"Places\""
sequelize.query(selectQuery).success((resources) ->
multi = redisClient.multi()
for resource in resources
createdb pgbouncer_bench
pgbench -i -s 10 pgbouncer_bench
pgbench -c 10 -C -T 60 pgbouncer_bench
pgbench -c 80 -C -T 60 pgbouncer_bench
pgbench -c 10 -C -T 60 -p 6432 pgbouncer_bench
pgbench -c 80 -C -T 60 -p 6432 pgbouncer_bench
class Array
def quick_sort
n = self.size
return self if n <= 1
pivot = self.last
less, more = [], []
for i in 0...n-1
item = self[i]
if item < pivot
@happyrobots
happyrobots / NSArray+BinarySearch.h
Created May 8, 2013 06:24
An Objective-C BinarySearch category on Array of which members are String. http://www.getappninja.com/blog/implementing-a-binary-search-in-ios
@interface NSArray (BinarySearch)
// Before calling this method, make sure this array is an array of string and it is sorted using sortedArrayUsingSelector:
// NSArray *sortedArray = [array sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
- (unsigned long)indexOfStringUsingBinarySearch:(NSString *)searchString;
@end
#!/bin/bash
sorted_commit_counts=`git shortlog -ns`
echo
echo "Commit Statistics by Authors"
echo "================================================"
echo
i=1
while read -r line; do
# spec/features/home_controller_spec.rb
require 'spec_helper'
describe HomeController do
describe "index" do
it "should check title page" do
visit '/home'
# puts "#{page.html}"
page.should have_content('I can has')
page.should have_selector('p', text: "I can has a content")
[alias]
try-prune = remote prune --dry-run
serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
st = status
ru = remote update
rv = remote -v
pom = push origin master
pr = pull --rebase

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: