Skip to content

Instantly share code, notes, and snippets.

@Jxck
Jxck / map.go
Created February 9, 2014 09:53
Not Atomic operation on Map
package main
import (
"log"
"runtime"
"sync"
)
var debug func(a ...interface{})
@Jxck
Jxck / benchmark.md
Last active August 29, 2015 13:56
benchmark of Generator in Go using Channel & Closure

on Mac Book Air (OSX 10.7.5) 1.6 GHz Intel Core i5 Memory 4GB

$ go test -bench .
PASS
BenchmarkClosure        100000000    11.5 ns/op
BenchmarkMutexClosure   50000000     35.3 ns/op
BenchmarkAtomicClosure 100000000 17.8 ns/op
@Jxck
Jxck / README.md
Last active August 29, 2015 13:57
Go Kyoto(Go勉強会 そうだ京都、行こう) のハンズオン資料 (http://www.zusaar.com/event/4367004)
@Jxck
Jxck / chain.js
Created July 2, 2015 03:05
Promise.chain()
new Promise(function (resolve) {
var pp = new Promise(function(r) {
setTimeout(function() {
r('aa');
}, 100);
});
setTimeout(function() {
resolve(pp);
}, 100);
var db = {
set: function(key, obj) {
localStorage.setItem(key, JSON.stringify(obj));
},
get: function(key) {
var tmp = localStorage.getItem(key);
return (tmp === undefined) ? null : JSON.parse(tmp);
},
@Jxck
Jxck / localstoratge-test.js
Created August 21, 2010 15:29
localStorageの挙動と簡単なラッパー http://jxck.hatenablog.com/entry/20100821/1282412125
module('localStorage',{
setup: function() {
localStorage.clear();
},
teardown: function() {
localStorage.clear();
}
});
test('localStorage exists and has methods',function(){
@Jxck
Jxck / gist:661854
Created November 3, 2010 22:48
test-je.js
log = function(a,b){
if(console.log){(!b)? console.log(a) : console.log(a);console.log(b);}
};
module('je', {
testdata: null,
docType: null,
docId: null,
/**
@Jxck
Jxck / gist:661851
Created November 3, 2010 22:48
je.js
log = function(a,b){
// if(console.log){(a)? console.log(a) : console.log(a);console.log(b);}
};
var je = {
baseURI: '/_je/',
POST: function(docType, data, callback, error) {
var jsonparam = { _doc: JSON.stringify(data) };
$.ajax({
type: 'post',
@Jxck
Jxck / paralell.js
Created January 30, 2011 07:13 — forked from yssk22/paralell.js
/***
* @function make the parallel request filters and finish with the last filter.
*
* @example
*
* misc.parallel(
* func1, func2, func3, func4
* );
*
* func1 ---+
@Jxck
Jxck / 0001-remove-pids-dir.patch
Created March 12, 2011 14:27
remove pids dir patch
From 67b1009502510dbbcdfbfe1621565e81d7422be7 Mon Sep 17 00:00:00 2001
From: Jxck <block.rxckin.beats@gmail.com>
Date: Sat, 12 Mar 2011 23:14:34 +0900
Subject: [PATCH] remove pids dir
---
bin/express | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/bin/express b/bin/express