Skip to content

Instantly share code, notes, and snippets.

View ahomu's full-sized avatar

Ayumu Sato ahomu

View GitHub Profile
var thunk = require('thunkify');
var delay = thunk(function(cb) {
setTimeout(function() {
console.log('delay end');
cb();
}, 1000);
});
var n = delay()
var co = require('co');
var stack = [
function *first(next) { // second generator
console.log('1 prev');
yield next; // second に delegate
console.log('1 next');
},
function *second(next) { // third generator
console.log('2 prev');
@ahomu
ahomu / php_AAPP_JSONProvider.php
Last active December 31, 2015 05:09
サンプルファイル ( filename の _ は / と脳内変換で )
<?php
class AAPP_JSONProvider extends ACMS_APP
{
public $version = '0.1';
public $name = 'ACMS JSON Provider';
public $author = 'mu.aho';
public $desc = 'a-blog cms のデータをJSON APIとして扱うための拡張です';
/**
* インストールする前の環境チェック処理
@ahomu
ahomu / gist:7614584
Created November 23, 2013 13:28
描画コマンド、300x300のRectに各スタイルエフェクトを適用
none
Draw 0.3790s
Clip Rect 0.0030ms
Restore 0.0010ms
Save 0.0000ms
Other 0.0000ms
Total 0.3830
dotted
@ahomu
ahomu / shot.js
Created November 23, 2013 08:08
めも
var page = require('webpage').create(),
system = require('system');
var url = system.args[1];
page.viewportSize = {
width : system.args[2] || 1024,
height: system.args[3] || 768
};
@ahomu
ahomu / gist:7212425
Created October 29, 2013 10:49
遊び捨てたpolymer
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
'use strict';
(function() {
/*jshint eqeqeq:false, maxparams:4 */
var COND_OPERATORS = {
'==' : function (l, r) { return l == r; },
'===': function (l, r) { return l === r; },
'!=' : function (l, r) { return l != r; },
'!==': function (l, r) { return l !== r; },
@ahomu
ahomu / h5v.js
Created June 27, 2013 03:54
grunt-html5validator .... 0.4.xで動作するかは不明 X(
/*
* grunt-html5validator
*
* @author ahomu
*/
module.exports = function(grunt) {
'use strict';
var TEMP_HTTP_RESOURCE = '.h5v.http.tmp',
@ahomu
ahomu / gist:5823669
Created June 20, 2013 15:18
いまいちだ...
/**
* Chikoque
*
* @author ahomu
*/
(function(win, doc, _) {
'use strict';
var defaults = {
@ahomu
ahomu / gist:5728342
Created June 7, 2013 10:14
.jshintrct
{
"globals": {
"Backbone": true,
"_": true,
"$": true,
"jQuery": true,
"Zepto": true
},
"maxlen": 100,