Skip to content

Instantly share code, notes, and snippets.

View lobotomit's full-sized avatar

lobotomit lobotomit

  • Madrid, Spain
View GitHub Profile
@lobotomit
lobotomit / socket-cheatsheet.js
Created June 5, 2018 15:43 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// 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
@lobotomit
lobotomit / 0_reuse_code.js
Created November 22, 2016 22:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console