This file contains hidden or 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 () { | |
// imports | |
//var _ = this._ || require('underscore'); | |
// common function 1 | |
var add = function (a, b) { | |
return a + b; | |
}; | |
// common function 2 |
This file contains hidden or 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
macbook-2:kyotocabinet-1.2.76 kazupon$ time make check > macbook_bench_log.txt | |
real 20m34.652s | |
user 3m12.845s | |
sys 4m11.813s |
This file contains hidden or 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
.DS_Store | |
node_modules | |
*~ | |
*.swp | |
*.bak | |
*.log |
This file contains hidden or 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
'use strict'; | |
var log = console.log.bind(console); | |
var format = require('util').format; | |
var kv = require('kv')('./kv'); | |
var ps = kv.put('hello/there'); | |
var rnd = Math.random(); | |
ps.write({ hello: rnd }); |
This file contains hidden or 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
'use strict'; | |
var log = console.log.bind(console); | |
var format = require('util').format; | |
var Model = require('scuttlebutt/model'); | |
var net = require('net'); | |
var m = new Model(); | |
var ms = m.createStream(); |
This file contains hidden or 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 through = require('through'); | |
var log = console.log.bind(console); | |
var ts = through(function (data) { // data pre event | |
this.queue(data); | |
}, function () { // end pre event | |
this.queue(null); | |
}); | |
var data = []; |
This file contains hidden or 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
// | |
// Created by Yogesh Swami on 2/24/12. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
// | |
// clang -Wall -Wextra -Wall -o mach_semaphore mach_semaphore.c | |
// | |
// using mach semaphore for mutually signalling between two threads. |
This file contains hidden or 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
CC=gcc | |
all: multi-process-counter | |
build: multi-process-counter | |
multi-process-counter: | |
${CC} -std=c99 -o multi-process-counter multi-process-counter.c | |
#${CC} -std=c99 -arch x86_64 -o multi-process-counter multi-process-counter.c |
This file contains hidden or 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
local fs = lev.fs | |
local co = _coroutine | |
t1 = co.create(function (...) | |
p(t1) | |
local err1, fd1 = fs.open('AUTHORS', 'r', '0666') | |
fs.close(fd1) | |
lev.exit() | |
end) | |
co.resume(t1) |
This file contains hidden or 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
INCDIR = $(HOME)/opt/local/include/luajit-2.0 | |
LIBDIR = $(HOME)/opt/local/lib | |
LIB = -lluajit-51 | |
all: native | |
native: | |
cc --std=c99 -o native-co native.c -I$(INCDIR) -L$(LIBDIR) $(LIB) -pagezero_size 10000 -image_base 100000000 | |
clean: |