Skip to content

Instantly share code, notes, and snippets.

@siong1987
siong1987 / gist:3103567
Created July 13, 2012 08:14
sparrow crash report
Process: Sparrow [1271]
Path: /Applications/Sparrow.app/Contents/MacOS/Sparrow
Identifier: com.sparrowmailapp.sparrow
Version: 1.6.2 (1143.6)
App Item ID: 417250177
App External ID: 8850448
Code Type: X86-64 (Native)
Parent Process: launchd [129]
Date/Time: 2012-07-13 03:12:13.699 -0500
@siong1987
siong1987 / awesome
Created May 25, 2012 15:22
crowdbooster job post
Hi, my name is Ricky Yean and I am Co-Founder and CEO of Crowdbooster.
After two years of building out the service for tens of thousands of
businesses around the world in just about every industry with just the
three co-founders, we are eager to hire our first employee. We hope
you will consider joining us at the most exciting stage of our startup.
Our mission is to help businesses use social media to build real
relationships with their customers. Imagine a world in which every
business is like the neighborhood coffee shop, run by real people.
They want to get to know you so they can better service you. You
@siong1987
siong1987 / gist:2145346
Created March 21, 2012 06:48 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3-p0
# Install with:
# bash < <(curl -L https://raw.github.com/gist/2145346)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0-falcon ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
@siong1987
siong1987 / gist:1855017
Created February 17, 2012 19:27 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3-p0
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1333785)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
@siong1987
siong1987 / .rvmrc
Created December 3, 2011 03:17
redis ORMs/mongo ORM benchmarks
rvm 1.9.2@ohm
@siong1987
siong1987 / benchmark_alphadecimal.rb
Created November 16, 2011 04:53
base62 convertor in ruby
require 'rubygems'
require 'benchmark'
require 'alphadecimal'
time = Benchmark.measure do
1_000_000.times do |i|
encode = i.alphadecimal
decode = encode.alphadecimal
raise "Assertion error!" unless i == decode
end
@siong1987
siong1987 / ge.py
Created October 4, 2011 20:17
gevent vs thread
#!/usr/bin/python
# Copyright (c) 2009 Denis Bilenko. See LICENSE for details.
"""Spawn multiple workers and wait for them to complete"""
hosts = ["http://yahoo.com", "http://google.com", "http://amazon.com", "http://ibm.com", "http://apple.com"]
import gevent
from gevent import monkey
class Foldle.Models.Folder extends Backbone.Model
paramRoot: 'folder'
urlRoot: '/folders'
defaults:
name: null
class Foldle.Collections.FoldersCollection extends Backbone.Collection
model: Foldle.Models.Folder
url: '/folders'
getFolderBySlug: (slug) ->
@siong1987
siong1987 / server.coffee
Created September 10, 2011 23:52
an example on how to get flo working with express.
app = require('express').createServer()
flo = require('../index').connect()
async = require 'async'
app.get '/', (req, res) ->
res.send('Up and running')
app.get '/search/:types/:term/:limit', (req, res) ->
types = req.params.types.split(',')
flo.search_term types, req.params.term, parseInt(req.params.limit), (err, results) ->
gsub = (source, pattern, replacement) ->
unless pattern? and replacement?
return source
result = ''
while source.length > 0
if (match = source.match(pattern))
result += source.slice(0, match.index)
result += replacement
source = source.slice(match.index + match[0].length)