Skip to content

Instantly share code, notes, and snippets.

View kazupon's full-sized avatar
🐤
Focusing vue-i18n and Intlify

kazuya kawaguchi kazupon

🐤
Focusing vue-i18n and Intlify
View GitHub Profile
var vows = require('vows');
var assert = require('assert');
assert.greater(5, 4);
assert.lesser(4, 5);
assert.isDefined(null);
assert.isDefined(1);
assert.isDefined({});
LESS_FILE = ./style.less
CSS_FILE = ./style.css
CSS_COMPRESS_FILE = ./style.min.css
LESS = lessc
build:
${LESS} ${LESS_FILE} | sed -e s/\'__\{/\{/g -e s/\}__\'/\}/g > ${CSS_FILE}
${LESS} --compress ${LESS_FILE} | sed -e s/\'__\{/\{/g -e s/\}__\'/\}/g > ${CSS_COMPRESS_FILE}
clean:
@kazupon
kazupon / cocproxy.nginx.conf
Created February 23, 2012 05:43 — forked from hotchpotch/cocproxy.nginx.conf
cocproxy for nginx
#!nginx -p . -c cocproxy.nginx.conf
error_log /dev/stderr debug;
daemon off;
events {
worker_connections 48;
}
http {
@kazupon
kazupon / base.jade
Created March 9, 2012 17:20
jade template inheritance
!!! 5
html
head
h1 My Site
block scripts
script(src="/jquery.js")
body
block header
header
p some header content
@kazupon
kazupon / play_script.js
Created March 18, 2012 05:31
play_script sample
var KyotoTycoon = require('kyoto-tycoon').KyotoTycoon;
var kt = new KyotoTycoon();
kt.play_script('echo', { key: 'value' }, function (err, data) {
if (err) { // error
// Somthing todo ...
return;
}
// success
-- global variables
kt = __kyototycoon__
db = kt.db
function toboolean (v)
return (type(v) == 'string' and v == 'true') or (type(v) == 'number' and v ~= 0) or (type(v) == 'boolean' and v)
end
function usage (outmap)
@kazupon
kazupon / gist:3594902
Created September 2, 2012 04:52
lev gyp build error ...
RetinaMBP:lev kazupon$ ./configure --arch=x64
configure options: {'debug': None, 'without_ssl': None, 'prefix': '/usr/local', 'arch': 'x64', 'skinny': None}
creating ./options.gypi
Generating build system with GYP...
['/Users/kazupon/Projects/opensource/lev/all.gyp', '-I', '/Users/kazupon/Projects/opensource/lev/common.gypi', '-I', '/Users/kazupon/Projects/opensource/lev/options.gypi', '--depth=.', '-f', 'make', '-f', 'xcode', '--generator-output', '/Users/kazupon/Projects/opensource/lev/out', '-Goutput_dir=/Users/kazupon/Projects/opensource/lev/out', '-Dcomponent=static_library', '-Dlibrary=static_library']
Done!
Now run `make -C out` to build!
# Machine spec
TODO:
# lev
* version: maglev branch (commit:b03a16d)
# luvit
* version: 0.5.0
for (var i = 0; i < 1e6; i++) {
b = new Buffer('hello world');
b[0] = 2;
}
@kazupon
kazupon / gist:3715938
Created September 13, 2012 17:18
core_print_all_handles segfault ...
✔ fs_link: 5/5 within 0.428 ms
✔ fs_fsync: 7/7 within 0.233 ms
✔ test core now: 2/2 within 0.007 ms
✔ test core get_process_title: 1/1 within 0.006 ms
[R--] timer 0x100330918
[---] <unknown> 0x4ddb0
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x000000010004022e in uv__print_handles (loop=0x1003306c0, only_active=0) at uv-common.c:348