Skip to content

Instantly share code, notes, and snippets.

Olivier Destenay tsbits

Block or report user

Report or block tsbits

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tsbits
tsbits / socket-cheatsheet.js
Created Oct 19, 2017 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
View socket-cheatsheet.js
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
View Scamed from emoc11
.film {
position: fixed;
top: 0;
left: 0;
background: url(‘../img/bg-1-vision.jpg’) no-repeat center / cover;
video {
position: relative;
width: 100%;
height: 100%;
@tsbits
tsbits / [ThreeJS] Antialias
Last active Nov 22, 2016
[ThreeJS] Antialias
View [ThreeJS] Antialias
renderer = new THREE.WebGLRenderer({antialias: true});
@tsbits
tsbits / [ThreeJS] Transparent background
Last active Nov 22, 2016
[ThreeJS] Transparent background
View [ThreeJS] Transparent background
renderer = new THREE.WebGLRenderer({alpha: true});
@tsbits
tsbits / [ThreeJS] Don't clear the canvas
Last active Apr 30, 2017
[ThreeJS] Don't clear the canvas
View [ThreeJS] Don't clear the canvas
renderer = new THREE.WebGLRenderer({preserveDrawingBuffer: true});
renderer.autoClearColor = false;
@tsbits
tsbits / [Terminal & finder] config & alias
Last active Dec 5, 2016
[Terminal & finder] config & alias
View [Terminal & finder] config & alias
// Show hidden files
defaults write com.apple.finder AppleShowAllFiles YES
// Reload Finder instances
killall Finder
// Show path in finder
Option + Command + P
// Show tab bar
@tsbits
tsbits / Normalize data to 0-1 range?
Created Feb 12, 2016
Normalize data to 0-1 range?
View Normalize data to 0-1 range?
var v = (value-min)/(max-min) ;
View countryCode.txt
Afar => aa
Abkhazian => ab
Avestan => ae
Afrikaans => af
Akan => ak
Amharic => am
Arabic => ar
Assamese => as
Avar => av
Aymara => ay
@tsbits
tsbits / Terminal :
Created Jun 11, 2015
Open multiple slack on OSX Desktop
View Terminal :
open -n /Applications/Slack.app
@tsbits
tsbits / main.js
Created Apr 13, 2015
Renaming an image sequence with nodeJS & fs
View main.js
var fs = require('fs');
//That function list all the files in the directory.
//Loop all the file in the folder
//If the current object is a folder -> ignore it
//Else if the file name index of 'mairie' (the original image sequence file was named "mairie"+n, where n started at 200)
//rename it in "mairie"+i, to get an image sequence that begin at 0 and not 200
function getFiles (dir, files_){
files_ = files_ || [];
var files = fs.readdirSync(dir);
You can’t perform that action at this time.