Skip to content

Instantly share code, notes, and snippets.

var dom = require("jsdom/jsdom/level2/core").dom.level2.core;
var browser = require("jsdom/jsdom/browser");
exports.createWindow = function() {
var bom = browser.browserAugmentation(dom);
var window = browser.windowAugmentation(dom);
for (var key in bom) window[key] = bom[key];
return window;
}
@bebraw
bebraw / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n
require.extensions[".json"] = function (module, filename) {
module.exports = JSON.parse(require("fs").readFileSync(filename, "utf8"))
}
@paulirish
paulirish / rAF.js
Last active July 19, 2024 19:50
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@d2m
d2m / gist:1935339
Created February 28, 2012 21:42
dart document.cookie lib
/*
* dart document.cookie lib
*
* ported from
* http://www.quirksmode.org/js/cookies.html
*
*/
void createCookie(String name, String value, int days) {
String expires;
@impressiver
impressiver / raven-config.html
Last active July 27, 2024 16:50
Raven.js configuration for logging JavaScript exceptions to Sentry (https://getsentry.com/). Without the added ignore options, you'll quickly find yourself swamped with unactionable exceptions due to shoddy browser plugins and 3rd party script errors.
<!-- Raven.js Config -->
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script>
<script type="text/javascript">
// Ignore list based off: https://gist.github.com/1878283
var ravenOptions = {
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion.
// See: https://github.com/getsentry/raven-js/issues/73
ignoreErrors: [
// Random plugins/extensions
'top.GLOBALS',
@damondouglas
damondouglas / Angular-Dart-Check-Lists.md
Last active April 27, 2017 06:45
Angular Dart Check Lists

Angular Dart Check List

The following shows what to watch out for when making Angular Dart applications. For more information about Angular Dart, see angulardart.org.

Table Of Contents

@eugene1g
eugene1g / AutogrowingTextarea.js
Last active January 12, 2017 02:29
React component for auto-expanding textareas
"use strict";
import React, {Component} from 'react';
import calcContentHeight from './dom-textarea-measure';
class AutogrowingTextarea extends Component {
constructor(props) {
this.props = props;
this.state = {};
this.textareaProps = sanitizeChildProps(props);
function counterA(state = 0, action) {
switch (action.type) {
case 'increment':
return state + 1
case 'decrement':
return state - 1
default:
return state
}
}
@kitze
kitze / animate-equal.js
Last active May 27, 2016 17:12
taking js mixins too far
export const animateEqual = (properties, ...values) => {
const percentIncrease = 100 / (values.length - 1);
let result = {};
let percent = 0;
_.each(values, value => {
let styles = {};
_.each(value, (n, i) => {
const prop = properties[i];
styles = _.extend(styles, _.isFunction(prop) ? prop.apply(this, [n]) : {[prop]: n})