Skip to content

Instantly share code, notes, and snippets.

View phannmalinka's full-sized avatar

malinka phannmalinka

  • Phnom Penh, Cambodia
View GitHub Profile
void main() {
var peoples = [
{ "id": 0, "name": "userA" },
{ "id": 1, "name": "userB" }
];
peoples.forEach((person) => print(person));
}
// when someone draws on the canvas, all the other connected people on the site can't draw,
// unless the timeout is reached or the user who is drawing quits or refresh the page.
// let's say myCanvas is the current html canvas
var myCanvas = .......
// timer
var timer = null;
// this is current user
@phannmalinka
phannmalinka / gist:83ed0173f5ae5bfd101651066dd611ac
Last active June 1, 2017 13:26
A code snippet to create a class using requirejs structure style. Thank @jonnyreeves for this great structure. https://gist.github.com/jonnyreeves/2474026#file-person-js-L111
"Class": {
"prefix": "class",
"body": [
"/*===================================",
"** Author: Malika",
"** Email: malika.phann@gmail.com",
"** Description:",
"**",
"**===================================",
"**/",