This file contains hidden or 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 request = require('request'); | |
| var concat = require('concat-stream'); | |
| var u = 'http://localwiki.net/api/v2/page_version?format=json'; | |
| recch(u, 0) | |
| function recch(url, numreq){ | |
| request(url).pipe(concat(function (body) { | |
| var obj = JSON.parse(body); |
This file contains hidden or 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 http = require('http'); | |
| var fs = require('fs'); | |
| var hyperstream = require('hyperstream'); | |
| var article = require('markdown-directory')(__dirname + '/articles'); | |
| var server = http.createServer(function (req, res) { | |
| if(req.url == "/"){ | |
| fs.readdir(__dirname + '/articles', function (err, files) { |
This file contains hidden or 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
| return function (r, w) { | |
| for (var i = 0; i < w.data.length; i += 4) { | |
| w.data[i] = Math.floor((Math.sin(r.data[i])+5)); | |
| w.data[i+1] = Math.floor((Math.sin(r.data[i]/40)+1)*5); | |
| w.data[i+2] = Math.floor((Math.sin(r.data[i+1]/8)+1)*255); | |
| w.data[i+3] = 255; | |
| } | |
| } |
This file contains hidden or 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
| return function (r, w) { | |
| for (var i = 0; i < w.data.length; i += 4) { | |
| w.data[i] = Math.floor((Math.sin(r.data[i])+5)); | |
| w.data[i+1] = Math.floor((Math.tan(r.data[i]/125))*5); | |
| w.data[i+2] = Math.floor((Math.sin(r.data[i]))); | |
| w.data[i+3] = 255; | |
| } | |
| } |
This file contains hidden or 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
| return function (r, w) { | |
| for (var i = 0; i < w.data.length; i += 4) { | |
| w.data[i] = Math.floor((Math.sin(r.data[i]))*255); | |
| w.data[i+1] = Math.floor((Math.tan(r.data[i]/80)-1)*255); | |
| w.data[i+2] = Math.floor((Math.sin(r.data[i]))* 20555); | |
| w.data[i+3] = 255; | |
| } | |
| } |
This file contains hidden or 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
| return function (r, w) { | |
| for (var i = 0; i < w.data.length; i += 4) { | |
| w.data[i] = Math.floor((Math.sin(r.data[i])+5)*255); | |
| w.data[i+1] = Math.floor((Math.tan(r.data[i]/8))*255); | |
| w.data[i+2] = Math.floor((Math.sin(r.data[i]))); | |
| w.data[i+3] = 255; | |
| } | |
| } |
This file contains hidden or 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 loadsvg = require('load-svg'); | |
| var createsvg = require('svg-create-element'); | |
| function createSprite (elems) { | |
| var bounds = []; | |
| for (var i = 0; i < elems.length; i++) { | |
| elems[i].style.display = 'block'; | |
| bounds[i] = elems[i].getBoundingClientRect(); | |
| } |
This file contains hidden or 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 createGame = require('voxel-hello-world') | |
| var game = createGame({ | |
| generate: function(x, y, z) { | |
| return y === 1 ? 1 : 0 | |
| }, | |
| materials: [['grass', 'dirt', 'grass_dirt'], 'brick', 'dirt', | |
| 'gold_ore', 'hardened_clay_stained_cyan', ], | |
| }) | |
| window.game = game |
This file contains hidden or 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
| master = new AudoContext() | |
| sampleRate = master.sampleRate | |
| jsynth = require('jsynth') | |
| oz = require('oscillators') | |
| amod = requoire('amod') | |
| music = function(t, s, i){ | |
| return oz.sine(t, 54 * 2) * amod(.5, .5, t, 1/6) | |
| } |
This file contains hidden or 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
| master = new AudoContext() | |
| sampleRate = master.sampleRate | |
| jsynth = require('jsynth') | |
| oz = requdire('oscillators') | |
| amod = requoire('amod') | |
| mic = require('jsynth-mic')(master) | |
| mic.on('node', function(node){ | |
| node.connect(synth) |
OlderNewer