Skip to content

Instantly share code, notes, and snippets.

View tomoh1r's full-sized avatar
💭
I may be slow to respond.

NAKAMURA, Tomohiro tomoh1r

💭
I may be slow to respond.
View GitHub Profile
@tomoh1r
tomoh1r / test_prototype.js
Created December 15, 2012 14:36
プロトタイプに何が設定されているか確認
'use strict';
var Hoge = Object.create(null);
var h = Object.create(Hoge);
console.log(Hoge == Object.getPrototypeOf(h));
// => true
@tomoh1r
tomoh1r / test.js
Last active December 11, 2015 11:18
function の解釈のタイミングがミソ
'use strict';
(function() {
var proto = Hoge.prototype;
function Hoge() {
// some implements ...
}
// some implements ...
})();
@tomoh1r
tomoh1r / gjslint.vim
Created January 23, 2013 01:04
自分用
if exists("current_compiler")
finish
endif
let current_compiler = "gjslint"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal
endif
CompilerSet makeprg=gjslint\ %
@tomoh1r
tomoh1r / hoge.js
Last active December 12, 2015 04:08
1. 「0」を出力する 2. 1秒待つ 3. 「1」を出力する 4. 1秒待つ 5. 「2」を出力する see http://techblog.yahoo.co.jp/programming/js_callback/
'use strict';
(function(seq) {
var hoge = function(seq) {
// timeout の秒数 (ms)
var timeout = 1 * 1000;
// 与えられた配列の length が 0 なら終わり
if (seq.length == 0) return;
@tomoh1r
tomoh1r / README.rst
Last active December 15, 2015 01:49
Buildout 用の hogerecipe。 src/hoge.py というファイルを書き出す。 djangorecipe が簡潔にまとまっていたので参考にした。 template (boilerplate ?) に Jinja2 を利用するとどうかと思い書いた。
@tomoh1r
tomoh1r / ziptest.sh
Created April 18, 2013 10:21
zip test ワンライナー、セミコロン無しバージョン
python -c "with getattr(__import__('zipfile', globals(), locals(), [], -1), 'ZipFile')('hoge.zip', 'r') as zfp: print(not bool(zfp.testzip()))"

hoge

@tomoh1r
tomoh1r / README.rst
Last active December 20, 2015 04:09
Use multi Dropbox account on single Mac OS X

Use multi Dropbox account on single Mac OS X

How to use

$ touch ~/Library/LaunchAgents/local.dropbox.personal.plist
@tomoh1r
tomoh1r / matome.rst
Last active December 29, 2015 03:09
FreeBSD

FreeBSD

目次

FreeBSD

@tomoh1r
tomoh1r / find_in_set.sql
Last active December 30, 2015 07:49
FIND_IN_SET 便利っぽい
mysql> STATUS
--------------
mysql Ver 14.14 Distrib 5.5.27, for Linux (x86_64) using readline 5.1
Connection id: 1
Current database: hogefugapiyo
Current user: spamspamspam@localhost
SSL: Not in use
Current pager: /usr/bin/less
Using outfile: ''