Skip to content

Instantly share code, notes, and snippets.

Using native MySQL
Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
[master][~/Projects/rails] rake -T
(in /Users/siong1987/Projects/rails)
rake clobber_package # Remove package products
rake clobber_rdoc # Remove rdoc products
rake default # Run all tests by default
rake gem # Run gem task for all projects / Build the gem file rails-3.0.0.beta1.gem
rake gemspec # Run gemspec task for all projects
rake package # Run package task for all projects / Build all the packages
rake pdoc # Publish API docs for Rails as a whole and for each component
rake pgem # Run pgem task for all projects
long t1 = System.currentTimeMillis();
task.run(); // task is a Runnable which encapsulates the unit of work
long t2 = System.currentTimeMillis();
System.out.println("My task took " + (t2 - t1) + " milliseconds to execute.");
From 995b8ba05516a3e8d53db30b153da38382dbc15d Mon Sep 17 00:00:00 2001
From: siong1987 <siong1987@gmail.com>
Date: Fri, 1 Oct 2010 05:18:34 -0500
Subject: [PATCH] update memcached store.
---
Gemfile | 2 +-
Gemfile.lock | 4 ++--
config/environment.rb | 1 +
config/environments/production.rb | 4 +---
* Brilliant, Crazy, Cocky: How the Top 1% of Entrepreneurs Profit from Global Chaos
* Start Small, Stay Small: A Developer's Guide to Launching a Startup
* The Art of Game Design: A book of lenses
* Crucial Conversations: Tools for Talking When Stakes are High
* The Personal MBA: Master the Art of Business
* The Greatest Secret in the World
* Do More Faster: TechStars Lessons to Accelerate Your Startup
* JavaScript: The Good Parts
* What's Mine Is Yours: The Rise of Collaborative Consumption
* The No Asshole Rule: Building a Civilized Workplace and Surviving One That Isn't
HTTP_STATUS_CODES = {
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
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)
@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) ->
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 / 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