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
# First install tmux | |
brew install tmux | |
# For mouse support (for switching panes and windows) | |
# Only needed if you are using Terminal.app (iTerm has mouse support) | |
Install http://www.culater.net/software/SIMBL/SIMBL.php | |
Then install https://bitheap.org/mouseterm/ | |
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
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
#import <Objective-LevelDB/LevelDB.h> | |
#import <Objective-LevelDB/LDBWriteBatch.h> | |
#include <mach/mach_time.h> | |
#include <stdint.h> | |
NSString *randomString(NSUInteger length) { | |
NSMutableString *string = [NSMutableString stringWithCapacity:length]; | |
for (int i = 0; i < length; i++) { | |
[string appendFormat:@"%C", (unichar)('a' + arc4random_uniform(25))]; | |
} |
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
asyncFunction: (x, y, z) ~> | |
yield | |
readFirstFile: (dir, ~, error) ~> | |
[err, files]: fs.readdir dir, ~ | |
return error(err) if err | |
[err, out]: fs.readFile files[o], ~ | |
return error(err) if err | |
yield 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
(function(){ | |
var asyncFunction, cacheData, map, readFirstFile; | |
asyncFunction = function asyncFunction(x, y, z, __callback) { | |
// some code, and eventually ... | |
return __callback(); | |
// initiated with an empty `yield` | |
}; | |
readFirstFile = function readFirstFile(dir, __callback, error) { | |
return fs.readdir(dir, (function(__this) { | |
var __func = function(err, files) { |
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
[err, files]: fs.readdir 'test', defer | |
files.forEach (file) -> | |
return unless file.ext is '.coffee' | |
[err, code]: fs.readFile file, defer | |
CoffeeScript.run code | |
=> | |
fs.readdir('test', (function(__this) { | |
var __func = function() { |
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
handleerr: (fn, args...) ->> | |
if ([err, out]: fn args..., defer)[0] then throw error(err) | |
else resume out | |
safe_readdir: handleerr <- {}, fs.readdir | |
safe_readfile: handleerr <- {}, fs.readFile | |
readFirstFile: (dir) ->> | |
try: | |
files: safe_readdir dir, defer |
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
handleerr: (fn, arg) ->> | |
if ([err, out]: fn arg, defer)[0] then throw error(err) | |
else resume out | |
safe_readdir: handleerr <- {}, fs.readdir | |
safe_readfile: handleerr <- {}, fs.readFile | |
readFirstFile: (dir) ->> | |
try: | |
files: safe_readdir dir, defer |
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
class UsingNode extends BaseNode | |
type: 'Using' | |
constructor: (object, methods) -> | |
@object: object | |
@methods: methods | |
compile_node: (o) -> | |
if @methods[0] == "*" | |
"for(var p in $@object) eval('var ' + p + '=' + $@object[p])" |
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
exports.Backend: class RedisBackend extends Backend | |
CONTENT: 'content' | |
DEPS: 'dependencies' | |
DATE: 'date' | |
constructor: (config) -> | |
@host: config.host || '127.0.0.1' | |
@port: config.port || 6379 | |
@db: config.db || 0 | |
@client: new redis.Client(@port, @host) |
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
cache: (file) -> | |
@test file, => | |
file.group: @name | |
@getPreparedContent file, => | |
@resolveDependencies file, => | |
@emit "resolvedDependencies", file | |
@backend.set file, (err) => | |
sys.puts "Could not cache file $file.path" if err | |
@emit "cachedFile", file |
OlderNewer