Skip to content

Instantly share code, notes, and snippets.

View kzms2's full-sized avatar

Kazumasa Okabe kzms2

View GitHub Profile
@kzms2
kzms2 / client.js
Created July 18, 2018 05:19 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@kzms2
kzms2 / 0_reuse_code.js
Created June 10, 2014 02:11
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