Skip to content

Instantly share code, notes, and snippets.

@ChiChou
ChiChou / port-forward.js
Last active August 29, 2015 14:08
Port forward written in NodeJS
var net = require('net'),
domain = require('domain');
var addrRegex = /^(([a-zA-Z\-\.0-9]+):)?(\d+)$/;
var addr = {
from: addrRegex.exec(process.argv[2]),
to: addrRegex.exec(process.argv[3])
};
@ChiChou
ChiChou / CSS3DObject.js
Last active August 29, 2015 14:09
CSS3DObject for THREE.js
/**
* Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
* @author mrdoob / http://mrdoob.com/
*
*/
THREE.CSS3DObject = function (element) {
THREE.Object3D.call(this);
this.element = element;
@ChiChou
ChiChou / transport_elastic_search.js
Last active August 29, 2015 14:11
Transport filtered ElasticSearch data from remote server to local, for development and testing.
'use strict';
var os = require('os');
var elasticsearch = require('elasticsearch');
var argv = require('minimist')(process.argv.slice(2));
var async = require('async');
/**
* get options from command line
*
@ChiChou
ChiChou / config.json
Last active August 29, 2015 14:13 — forked from anonymous/config.json
Bootstrap build config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@ChiChou
ChiChou / docker-clean.sh
Created January 13, 2015 07:01
Remove all docker instances
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@ChiChou
ChiChou / DeviceOrientationController.js
Last active September 10, 2017 02:03
Improved DeviceOrientationController for THREE.js, forked from threeVR
/**
* -------
* threeVR (https://github.com/richtr/threeVR)
* -------
*
* W3C Device Orientation control (http://www.w3.org/TR/orientation-event/)
* with manual user drag (rotate) and pinch (zoom) override handling
*
* Author: Rich Tibbett (http://github.com/richtr)
* License: The MIT License
@ChiChou
ChiChou / es5.index.js
Last active August 29, 2015 14:14
simple module loader
'use strict';
var fs = require('fs');
var path = require('path');
// load all modules in same directory
fs.readdirSync(__dirname)
.filter(function(fileName) {
return path.join(__dirname, fileName) !== __filename;
})
@ChiChou
ChiChou / github.css
Last active September 3, 2015 00:55
Style bots
* {
border-bottom-left-radius: 0 !important;
border-bottom-right-radius: 0 !important;
border-radius: 0 !important;
border-top-left-radius: 0 !important;
border-top-right-radius: 0 !important;
}
@ChiChou
ChiChou / bling.js
Last active August 8, 2024 04:04 — forked from paulirish/bling.js
/**
* bling.js
*/
window.$ = document.querySelectorAll.bind(document);
window.$id = document.getElementById.bind(document);
Array.prototype.each = Array.prototype.forEach;
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, delegate, fn) {