This file contains hidden or 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
function Handler(fn) { | |
this.func = fn; | |
return this; | |
} | |
Handler.prototype.handle = function(errMsg, callback) { | |
this.exceptions[errMsg] = callback; | |
} | |
Handler.prototype.try = function(context) { | |
context = context || this; | |
try { |
This file contains hidden or 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
// return an array of argument names | |
function getArgNames(fn) { | |
var matches = fn.toString().match(/\(([a-z_, ]+)\)/i); | |
if (matches.length > 1) { | |
return matches[1].replace(/\s+/g, '').split(','); | |
} | |
return []; | |
} | |
// some sample implementation |
This file contains hidden or 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
'use strict'; | |
var INTERVAL = 50; | |
class Bubble { | |
constructor() { | |
this.x = parseInt(window.innerWidth * Math.random(), 10); | |
this.y = parseInt(window.innerHeight * Math.random(), 10); | |
this.xDir = Math.random() > 0.5 ? 1 : -1; | |
this.yDir = Math.random() > 0.5 ? 1 : -1; | |
this.size = parseInt(Math.random() * 100) + 40; |
OlderNewer