Skip to content

Instantly share code, notes, and snippets.

View JonatanS's full-sized avatar

Jonatan Schumacher JonatanS

View GitHub Profile
@JonatanS
JonatanS / socket-cheatsheet.js
Created March 9, 2018 17:54 — 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
@JonatanS
JonatanS / Secret Number Game in Ruby
Last active August 29, 2015 14:24
A homework assignment to learn Ruby during the Backend class at GA in the Fall 2014
###############################################################################
#
# We're ready to program! To practice our Ruby skills lets create a secret
# number game. In this game players have three tries to guess a secret number
# between 1 and 10.
#
# Here are some guidelines to building your game:
#
# Intros
# - Welcome the player to your game. Let them know who created the game.