Skip to content

Instantly share code, notes, and snippets.

View thibauts's full-sized avatar

Thibaut Séguy thibauts

View GitHub Profile
@thibauts
thibauts / index.js
Created April 2, 2015 21:06
Packages used along some package
$ node index.js gl-shader
11 gl-buffer
11 gl-vao
10 gl-texture2d
10 ndarray
6 glslify
6 a-big-triangle
5 gl-fbo
5 gl-mat4
5 typedarray-pool
@thibauts
thibauts / index.js
Created March 8, 2015 12:50
requirebin sketch
var shell = require('gl-now')();
var bunny = require('bunny');
var normals = require('normals');
var createGeometry = require('gl-geometry');
var createShader = require('gl-shader');
var mat4 = require('gl-matrix').mat4;
var RBF = require('rbf');
var geom, shader, start;
@thibauts
thibauts / index.js
Last active August 29, 2015 14:16
requirebin sketch
var shell = require('gl-now')();
var bunny = require('bunny');
var normals = require('normals');
var createGeometry = require('gl-geometry');
var createShader = require('gl-shader');
var mat4 = require('gl-matrix').mat4;
var RBF = require('rbf');
var geom, shader, start, warped;
@thibauts
thibauts / index.js
Created March 6, 2015 23:09
requirebin sketch
var shell = require('gl-now')();
var bunny = require('bunny');
var normals = require('normals');
var createGeometry = require('gl-geometry');
var createShader = require('gl-shader');
var mat4 = require('gl-matrix').mat4;
var encode = require('pop-buffer').encode;
var decode = require('pop-buffer').decode;
{ id: 19789,
name: 'Main Chunk',
length: 687696,
children:
[ { id: 2, name: 'Version', length: 10 },
{ id: 15677,
name: '3D Editor Chunk',
length: 679823,
children:
[ { id: 15678, name: 'Unknown', length: 10 },
var express = require('express');
var subtitlesUrl = 'http://your-local-ip:8000/subtitles.vtt';
var app = express();
app.use(function(req, res, next) {
res.header('transferMode.dlna.org', 'Streaming');
res.header('contentFeatures.dlna.org', 'DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000')
res.header('CaptionInfo.sec', subtitlesUrl);
@thibauts
thibauts / stream-stream.js
Last active August 3, 2018 11:44
Takes a stream of filenames on stdin and outputs the file contents on stdout each time a new filename is pushed.
/*
* Takes a stream of filenames on stdin and outputs
* the file contents on stdout each time a new filename is pushed.
*/
var _ = require('highland');
var fs = require('fs');
function foo(filename) {
return _(fs.createReadStream(filename)); // `sequence()` expects an highland stream so let's wrap
}
@thibauts
thibauts / index.js
Last active August 29, 2015 14:08
Simple SSE middleware with implicit routing
var app = express();
var sse = new SSE();
app.get('/foo', function() {
sse.emit('sse', { message: 'hello, sse !' });
});
app.use('/sse', sse.forward('sse')); // The param to forward is the name of the dispatched event
@thibauts
thibauts / Makefile
Last active December 3, 2021 03:39
Example Makefile publishing to gh-pages
# Publishes the html counterpart to index.md to the repo's gh-pages branch root
dist/%.html: %.md
pandoc -f markdown -t html $< > $@
build: dist/index.html
clean:
rm -rf dist/*
publish: build
@thibauts
thibauts / getContents.js
Created May 9, 2014 22:43
Simpler way to get the contents of a webpage
var request = require('request');
request(process.argv[2], function(err, res, body) {
console.log(body);
});