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
_.mixin({ | |
pluckNest: function(obj,names){ | |
return _.reduce(names,function(o,n){ | |
return _.pluck(o,n) | |
},obj); | |
} | |
}); |
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 fs = require('fs'), | |
crypto = require('crypto'); | |
var through = require('through'), | |
base64 = require('base64-stream'), | |
mime = require('mime'), | |
koa = require('koa'), | |
router = require('koa-router'), | |
parse = require('co-busboy'), | |
level = require('level'), |
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
require 'scissor/echonest' | |
s = Scissor(ARGV.shift) | |
Scissor.join( | |
s.bars.map do |bar| | |
segment = bar / 32 | |
Scissor.join(segment.each_slice(4).to_a.map{|x| x.sort_by{rand}}.flatten) | |
end | |
) >> 'out.mp3' |
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
;; db => https://github.com/Factual/clj-leveldb | |
;; json => https://github.com/clojure/data.json | |
(def json-db (atom nil)) | |
(defn val-encoder [m] | |
(let [s (json/write-str m)] | |
(byte-array (map byte s)))) | |
(defn val-decoder [ba] | |
(let [s (byte-streams/to-string ba) |
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
-- 水戸黄門の曲のイントロはクロスリズムになってるよ | |
bps 0.85 | |
-- 4/4 | |
d1 $ sound "[[bd*4], [~ sn:1 ~ sn:1], [hc hc hc ho:1]]" | |
-- 3/4 | |
d1 $ sound "[[bd*3], [~ sn:1 [~ sn:1 ~ ~]], [hc hc ho:1]]" | |
-- beat off | |
d1 $ silence |
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 clc = require('cli-color'); | |
//// cli-color progress bar | |
function make_bar(t,cu){ | |
var ret = []; | |
var s = 10; //step | |
var c = cu/s; | |
var r = s-c; | |
for(var i=0; i<c; i++){ ret.push(clc.white('|')) } |
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 Readable = require('stream').Readable, | |
exec = require('child_process').exec; | |
var clc = require('cli-color'), | |
csv2 = require('csv2'), | |
through2 = require('through2'); | |
function getVolume(){ | |
var rs = new Readable; | |
var cmd = 'osascript -e "get volume settings"'; |
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 thr = require('through2'); | |
module.exports = function(v){ | |
return thr(function(c,e,n){ | |
this.push(v(c)); | |
n(); | |
}); | |
}; | |
if(!module.parent){ |
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 browserify = require('browserify'), | |
gulp = require('gulp'), | |
source = require('vinyl-source-stream'), | |
brfs = require('brfs'), // -> if use | |
babelify = require('babelify'), // -> for es6, react | |
uglify = require('gulp-uglify'); | |
var liveServer = require('live-server'); | |
gulp.task('browserify', function() { |
OlderNewer