Skip to content

Instantly share code, notes, and snippets.

View shinout's full-sized avatar
🏠
Working from home

Shin Suzuki shinout

🏠
Working from home
View GitHub Profile
@lsbardel
lsbardel / redis-server-for-init.d-startup
Created December 15, 2009 21:01 — forked from mtodd/redis-server-for-init.d-startup
Init.d Redis script for Ubuntu
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@uasi
uasi / vim.rb
Created November 30, 2010 16:46
Vim formula for Homebrew (EDIT: recent versions of official Homebrew distribution includes one)
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.682'
def features; %w(tiny small normal big huge) end
@guybrush
guybrush / nodeconf_2011.md
Created May 6, 2011 07:22
a list of slides from nodeconf 2011
@laverdet
laverdet / binlog-tailer.js
Created May 6, 2011 07:56
MySQL binlog tailer
"use strict";
this.MysqlBinlogTailer = MysqlBinlogTailer;
var EventEmitter = require('events').EventEmitter;
var fs = require('fs');
var path = require('path');
/**
* Tails a Mysql binlog and emits an event for every query executed.
*/
[65/65] cxx_link: build/debug/src/node_main_9.o build/debug/src/node_9.o build/debug/src/node_buffer_9.o build/debug/src/node_javascript_9.o build/debug/src/node_extensions_9.o build/debug/src/node_http_parser_9.o build/debug/src/node_constants_9.o build/debug/src/node_events_9.o build/debug/src/node_file_9.o build/debug/src/node_script_9.o build/debug/src/node_os_9.o build/debug/src/node_dtrace_9.o build/debug/src/node_string_9.o build/debug/src/timer_wrap_9.o build/debug/src/tcp_wrap_9.o build/debug/src/cares_wrap_9.o build/debug/src/node_cares_9.o build/debug/src/node_net_9.o build/debug/src/node_signal_watcher_9.o build/debug/src/node_stat_watcher_9.o build/debug/src/node_io_watcher_9.o build/debug/src/node_stdio_9.o build/debug/src/node_child_process_9.o build/debug/src/node_timer_9.o build/debug/src/platform_darwin_9.o build/debug/src/node_crypto_9.o build/debug/deps/http_parser/http_parser_5.o -> build/debug/node_g
/usr/bin/g++ debug/src/node_main_9.o debug/src/node_9.o debug/src/node_buffer_9.o debug/
@sundayu
sundayu / protobuf.js
Created July 28, 2011 07:26
Reads an unsigned 64 bit integer from the buffer at the specified offset; readUInt64, writeUInt64 for Nodejs
var _0x100000000000000 = 0x100000000000000,
_0x1000000000000 = 0x1000000000000,
_0x10000000000 = 0x10000000000,
_0x100000000 = 0x100000000,
_0x1000000 = 0x1000000,
_0x10000 = 0x10000,
_0x100 = 0x100,
_0xff = 0xff,
_0x80 = 0x80;
@dbamber
dbamber / test.js
Created September 13, 2011 21:06
Testing GOogle document api support for tables
/*
* Author: David Bamber <dbamber@gmail.com>
* http://bmbr.co
*
* Usage: node test.js -u <googleuser> -p <googlepass>
* node test.js -u <googleuser> -p <googlepass> -regex -url /feeds/default/private/full
*
* Optional Fags:
* -url [url]: requests a different uri from docs api, defaults to /feeds/default/private/full/-/table
* -regex: applies a regex to try and sanitize output
@akkunchoi
akkunchoi / yaruki.rb
Created October 8, 2011 01:50
やる気がない時に実行するコマンド
#!/usr/bin/env ruby
list = %w(
部屋を掃除しろ!
部屋を片付けろ!
資料を整理しろ!
タスクを整理しろ!
メモを整理しろ!
「あとで読む」でも読んどけ!
@shinout
shinout / main.js
Created November 10, 2011 07:20
redirecting stdout goes wrong when writing stdout from multi-processes
var fork = require("child_process").fork;
var workers = [];
for (var i=0; i<6; i++) { (function(i) {
workers[i] = fork(__dirname + "/worker.js");
workers[i].send(i);
})(i) }
@shinout
shinout / jis1.json
Created November 29, 2011 07:13
JIS第一水準漢字 + 常用漢字 in JSON format
["一","丁","七","万","丈","三","上","下","不","与","丑","且","世","丘","丙","丞","両","並","中","串","丸","丹","主","乃","久","之","乍","乎","乏","乗","乙","九","乞","也","乱","乳","乾","亀","了","予","争","事","二","云","互","五","井","亘","亙","些","亜","亡","交","亥","亦","亨","享","京","亭","亮","人","什","仁","仇","今","介","仏","仔","仕","他","付","仙","代","令","以","仮","仰","仲","件","任","企","伊","伍","伎","伏","伐","休","会","伝","伯","伴","伶","伸","伺","似","伽","佃","但","位","低","住","佐","佑","体","何","余","作","佳","併","佼","使","侃","例","侍","供","依","侠","価","侭","侮","侯","侵","侶","便","係","促","俄","俊","俗","保","信","俣","修","俳","俵","俸","俺","倉","個","倍","倒","倖","候","借","倣","値","倦","倫","倭","倶","倹","偉","偏","停","健","偲","側","偵","偶","偽","傍","傑","傘","備","催","傭","債","傷","傾","僅","働","像","僑","僕","僚","僧","僻","儀","億","儒","償","優","儲","允","元","兄","充","兆","兇","先","光","克","免","兎","児","党","兜","入","全","八","公","六","共","兵","其","具","典","兼","内","円","冊","再","冒","冗","写","冠","冥","冨","冬","冴","冶","冷","凄","准","凋","凌","凍","凝","凡","処","凧","凪","凱","凶","凸","凹","出","函","刀","刃","分","切","刈","刊","刑","列","初","判","別","利","到","制","刷","券","刺","刻"