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
// 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 |
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
renderer = new THREE.WebGLRenderer({antialias: true}); |
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
renderer = new THREE.WebGLRenderer({alpha: true}); |
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
renderer = new THREE.WebGLRenderer({preserveDrawingBuffer: true}); | |
renderer.autoClearColor = false; |
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
// 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 |
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 v = (value-min)/(max-min) ; |
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
Afar => aa | |
Abkhazian => ab | |
Avestan => ae | |
Afrikaans => af | |
Akan => ak | |
Amharic => am | |
Arabic => ar | |
Assamese => as | |
Avar => av | |
Aymara => ay |
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
open -n /Applications/Slack.app |
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'); | |
//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); |
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
// From http://stackoverflow.com/questions/9914816/what-is-an-example-of-the-simplest-possible-socket-io-example | |
var http = require('http'), | |
fs = require('fs'), | |
// NEVER use a Sync function except at start-up! | |
index = fs.readFileSync(__dirname + '/index.html'); | |
// Send index.html to all requests | |
var app = http.createServer(function(req, res) { | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
res.end(index); |
NewerOlder