Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'
var zlib = require('zlib'); | |
var completed = 0; | |
function printProcMem() { | |
if (completed % 100 == 0) { | |
var mem = process.memoryUsage(); | |
console.log('%d %d %d %d', | |
completed, mem.rss / 1000000, mem.heapTotal / 1000000, mem.heapUsed / 1000000); | |
} |
var arDrone = require('ar-drone'); | |
var client = arDrone.createClient(); | |
client.takeoff(); | |
client | |
.after(5000, function() { | |
this.clockwise(0.5); | |
}) | |
.after(3000, function() { |
var domain = require('domain'); | |
var d = domain.create() | |
var fs = require('fs') | |
server = require('http').createServer( | |
function(req, res) { | |
var d2 = domain.create(); | |
d2.add(req) | |
d2.add(res) |
Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'
# | |
# Get and install <repo>. | |
# | |
get() { | |
local prev=`pwd` | |
local repo=$1 | |
rm -fr /tmp/get \ | |
&& mkdir /tmp/get \ | |
&& cd /tmp/get \ |
<!-- | |
a few lines of code to make a url into a clickable link | |
using lazy star (.*?) and $0 | |
--> | |
<?php | |
$string = 'http://www.haha.com www.haha.com hahahaha https://www.haha.com'; | |
$string = $string." "; | |
$stringall = preg_replace('/((https:\/\/)|(http:\/\/)|(www\.))(.*?)(?=\s)/i','<a href="$0" target="_blank">$0</a>',$string); |
var insertElement = function(data, callback) { | |
var timeout = Math.ceil(Math.random() * 1000); | |
setTimeout(function() { | |
callback(null, data); | |
}, timeout); | |
}; | |
var insertAll = function(coll, callback) { | |
var queue = coll.slice(0), | |
elem; |
#Editing ##Keypress Command
h1. Sublime Text 2 - Useful Shortcuts (Mac OS X) | |
h2. General | |
| *⌘T* | go to file | | |
| *⌘⌃P* | go to project | | |
| *⌘R* | go to methods | | |
| *⌃G* | go to line | | |
| *⌘KB* | toggle side bar | | |
| *⌘⇧P* | command prompt | |