Skip to content

Instantly share code, notes, and snippets.

Avatar

Kazuhito Hokamura hokaccha

View GitHub Profile
@teramako
teramako / promise.js
Last active Dec 16, 2015
テキトウに Promise 実装。WeakMap とか for-of とか、その他 ECMAScript 6th 機能を使っているので、一般には使えないけど。
View promise.js
/*
* @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 Jan 9, 2013
CSS Radar @ Twitter / 2013.01.09 Wednesday Edition'
View five-2013-01-09.md
@studiomohawk
studiomohawk / google-reader-list.xml
Last active Dec 10, 2015
Google Readerリスト - 2013/03/13 ver.
View google-reader-list.xml
<?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 Oct 15, 2011
Express routes
View routes.js
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 Jul 15, 2011
3桁区切りフォーマット関数
View commify.js
/**
* アルゴリズム 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()
View markdown2inao.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage;
use Text::Markdown 'markdown';
use HTML::TreeBuilder;
use List::Util 'max';