Skip to content

Instantly share code, notes, and snippets.

View jaredwilli's full-sized avatar
🏄‍♂️

Jared Williams jaredwilli

🏄‍♂️
View GitHub Profile
@jaredwilli
jaredwilli / heart.js
Created May 2, 2012 14:40 — forked from paulirish/heart.js
sweetass heart canvas.
// 99% done by @rauri rochford
// http://js1k.com/2012-love/demo/1071
// i just rAF'd it.
// demo at http://bl.ocks.org/1823634
e = [];// trails
@jaredwilli
jaredwilli / gameengines.md
Created May 30, 2012 19:12 — forked from bebraw/gameengines.md
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 these pages: [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]].

Name Latest Release Size (KB) License Type Unit Tests Docs Repository Notes
ActionJS no github AS3 like in Javascript
Akihabara 1.3.1 (2011/05) 453 GPL2, MIT Classic Repro no API github Inten
@jaredwilli
jaredwilli / gist:3265812
Created August 5, 2012 16:35
forEach in javascript the right way
/*
forEach, version 1.0
Copyright 2006, Dean Edwards
License: http://www.opensource.org/licenses/mit-license.php
*/
// array-like enumeration
if (!Array.forEach) { // mozilla already supports this
Array.forEach = function(array, block, context) {
for (var i = 0; i < array.length; i++) {
@jaredwilli
jaredwilli / gist:3266726
Created August 5, 2012 19:10 — forked from zachleat/gist:980895
HTML5 Boilerplate Issue #378 (No Compatibility View button, tested in IE7/IE8/IE9)
<!--[if IE ]><![endif]-->
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@jaredwilli
jaredwilli / gist:3274317
Created August 6, 2012 13:01
javascript trim
if (!String.prototype.trim) {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,'');
}
}
@jaredwilli
jaredwilli / gist:3351591
Created August 14, 2012 18:43
requestNextAnimFrame()
window.requestNextAnimationFrame = (function() {
var originalWebkitMethod,
wrapper = undefined,
callback = undefined,
geckVersion = 0,
userAgent = navigator.userAgent,
index = 0,
self = this;
// Workaround for Chrome 10 bug where Chrome does
@jaredwilli
jaredwilli / gist:3351616
Created August 14, 2012 18:45
Canvas Vector Class and template thing
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script>
if (typeof Object.create !== "function") {
Object.create = function(o) {
function F() {}
@jaredwilli
jaredwilli / gist:3394806
Created August 19, 2012 13:30
Object.create support if not exists
if (typeof Object.create !== "function") {
Object.create = function(o) {
function F() {}
F.prototype = o;
return new F();
};
}
@jaredwilli
jaredwilli / gist:3394867
Created August 19, 2012 13:38
Timer - start/stop/update
var timerID = 0,
tStart = null,
clockID = null;
function UpdateTimer() {
if (timerID) {
clearTimeout(timerID);
clockID = 0;
}
@jaredwilli
jaredwilli / gist:3394878
Created August 19, 2012 13:40
Vector constructors
var Vector = {
init: function() {},
prototype: {
init: function() {}
},
create: function() {
var object = Object.create(this);
object.parent = this;
object.init.apply(object, arguments);
return object;