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 Game = require('crtrdg-gameloop'); | |
var canvas = document.createElement('canvas'); | |
canvas.id = 'game'; | |
var body = document.getElementsByTagName('body')[0]; | |
body.appendChild(canvas); | |
var game = new Game({ | |
canvasId: 'game', |
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 Game = require('crtrdg-gameloop'); | |
var canvas = document.createElement('canvas'); | |
canvas.id = 'game'; | |
var body = document.getElementsByTagName('body')[0]; | |
body.appendChild(canvas); | |
var game = new Game({ | |
canvasId: 'game', |
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 Game = require('crtrdg-gameloop'); | |
var canvas = document.createElement('canvas'); | |
canvas.id = 'game'; | |
var body = document.getElementsByTagName('body')[0]; | |
body.appendChild(canvas); | |
var game = new Game({ | |
canvasId: 'game', |
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 N = require('notification-count'); | |
var n = new N(); | |
setInterval(function(){ | |
n.add(); | |
},500) |
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 = document.createElement('video'); | |
v.id = 'myVideo'; | |
document.body.appendChild(v); | |
var getUserMedia = require('getusermedia'); | |
var attachMediaStream = require('attachmediastream'); | |
// get user media | |
getUserMedia(function (err, stream) { | |
// if the browser doesn't support user media |
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 vkey = require('vkey') | |
document.body.addEventListener('keydown', function(ev) { | |
console.log(vkey[ev.keyCode]) | |
}, 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Naive promise implementation</title> | |
</head> | |
<body> | |
<button id="a-button">Click</button> | |
</body> | |
</html> |
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
{ | |
"name": "foobar", | |
"version": "0.0.0", | |
"description": "foobar description", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"watch-js": "watchify js/app.js -o js/bundle.js", | |
"build-js": "browserify js/app.js > js/bundle.js", | |
"start": "http-server .", |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
browserify: { | |
dist: { | |
files: { | |
'build/module.js': ['js/**/*.js'] | |
} | |
} |
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
#!/bin/bash | |
rm -Rf ~/.Trash/* |