This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 995b8ba05516a3e8d53db30b153da38382dbc15d Mon Sep 17 00:00:00 2001 | |
From: siong1987 <[email protected]> | |
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 +--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OS X install instructions http://www.reddit.com/r/linux/comments/a3snu/pianobar_is_a_command_line_client_for_pandora_no/c0fupws | |
brew install libao | |
# brew install libfaad2 # not available with brew, skipped and is working ok... | |
brew install libmad | |
brew install cmake # (this takes a while) | |
# install | |
git clone git://github.com/PromyLOPh/pianobar.git | |
cd pianobar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using native MySQL | |
Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader | |
Started | |
....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
PARALLEL_CONNECTS = 10, | |
http = require('http'), | |
sys = require('sys'), | |
connectionCount = 0, | |
messageCount = 0; | |
lastMessages = 0; | |
function addClient() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(helloweb). | |
-export([start/0, stop/0]). | |
start() -> | |
mochiweb_http:start([ | |
{name, ?MODULE}, | |
{ip, any}, | |
{port, 6500}, | |
{loop, fun(Req) -> | |
Req:ok({"text/plain", "Hello, world"}) |