Skip to content

Instantly share code, notes, and snippets.

View hokaccha's full-sized avatar

Kazuhito Hokamura hokaccha

View GitHub Profile
@teramako
teramako / promise.js
Last active December 16, 2015 11:18
テキトウに Promise 実装。WeakMap とか for-of とか、その他 ECMAScript 6th 機能を使っているので、一般には使えないけど。
/*
* @example 1
* Promise.when(
* asyncFunc1(),
* asyncFunc2()
* ).then(
* function done (p1, p2){ console.log("resolved: ", p1.isResolved, p2.isResolved); },
* function reject(p1, p2){ console.log("rejected: ", p2.isRejected, p2.isRejected); }
* );
* function asycFunc1 () {
@studiomohawk
studiomohawk / five-2013-01-09.md
Created January 9, 2013 00:33
CSS Radar @ Twitter / 2013.01.09 Wednesday Edition'
@studiomohawk
studiomohawk / google-reader-list.xml
Last active December 10, 2015 18:09
Google Readerリスト - 2013/03/13 ver.
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>studiomohawk の Google リーダー登録フィード</title>
</head>
<body>
<outline text=".net" title=".net" type="rss"
xmlUrl="http://feeds.feedburner.com/net/topstories" htmlUrl="http://www.netmagazine.com"/>
<outline text="0 FPS" title="0 FPS" type="rss"
xmlUrl="http://0fps.wordpress.com/feed/" htmlUrl="http://0fps.wordpress.com"/>
@tj
tj / routes.js
Created October 15, 2011 00:23
Express routes
var app = require('../app');
console.log();
app.routes.all().forEach(function(route){
console.log(' \033[90m%s \033[36m%s\033[0m', route.method.toUpperCase(), route.path);
});
console.log();
process.exit();
@taiju
taiju / commify.js
Created July 15, 2011 06:33
3桁区切りフォーマット関数
/**
* アルゴリズム by Perlクックブック
* http://www.amazon.co.jp/Perlクックブック〈VOLUME1〉-トム-クリスチャンセン/dp/4873112028/
**/
var num = 1000000000000000000;
function commify(num, sep) {
return Array.prototype.slice.call(
Array.prototype.slice.call(num + '')
.reverse()
#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage;
use Text::Markdown 'markdown';
use HTML::TreeBuilder;
use List::Util 'max';