This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var deferred = require('deferred'); | |
var _ = require('lodash'); | |
var def = deferred(); | |
_.delay(function(){ | |
def.reject(new Error('error')); | |
//def.resolve('success'); | |
}, 1000); | |
def.promise.cb(function(result){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
var retry = require('retry'); | |
// 試行のサンプルメソッド | |
var test = function(callback){ | |
_.delay(function(){ | |
var arg; | |
//20%の確率で成功、みたぃな | |
var num = _.random(0, 4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'); | |
var retry = require('retry'); | |
var tasks = { | |
get: function(done){ | |
console.log('get'); | |
setTimeout(done, 1000); | |
}, | |
send: function(done){ | |
console.log('send'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'); | |
var tasks = { | |
get: function(done){ | |
console.log('get'); | |
setTimeout(done, 1000); | |
}, | |
send: function(done){ | |
console.log('send'); | |
//setTimeout(done, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//[email protected]ばん | |
var gulp = require('gulp'); | |
var stylus = require('gulp-stylus'); | |
gulp.task('stylus', function () { | |
return gulp.src('./styl/style.styl') | |
.pipe(stylus({ | |
url: { | |
//name:'url'とするとぜんぶのurl()がbase64埋め込みになる |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var stylus = require('gulp-stylus'); | |
var autoprefixer = require('autoprefixer-stylus'); | |
gulp.task('stylus', function () { | |
return gulp.src('./styl/style.styl') | |
.pipe(stylus({ | |
use: [autoprefixer('iOS >= 7', 'last 1 Chrome version')] | |
})) | |
.pipe(gulp.dest('./css')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var download = require('gulp-download'); | |
var unzip = require('gulp-unzip'); | |
gulp.task('webix', function(){ | |
return download('http://webix.com/skin-builder/data/aec0da36.zip') | |
.pipe(unzip()) | |
.pipe(gulp.dest('./dist/lib/webix/codebase/')) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var newer = require('gulp-newer'); | |
var svg2png = require('gulp-svg2png'); | |
var imagemin = require('gulp-imagemin'); | |
var pngquant = require('imagemin-pngquant'); | |
var path = { | |
svg2png : { | |
src : 'svg/*.svg', | |
dest : 'img' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// クライアントサイドの、まじてきとうなサンプルだょ | |
var util = require('util'); | |
var EventEmitter = util.EventEmitter; | |
var _ = require('lodash'); | |
var io = require('socket.io-client'); | |
function Chart(socket, max_length){ | |
this.ticks = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage | |
// just | |
// `gulp nw-gyp` | |
// or type node-webkit version | |
// `gulp nw-gyp --target 0.9.2` | |
var gulp = require('gulp'); | |
var exec = require('gulp-exec'); | |
var minimist = require('minimist'); |