Skip to content

Instantly share code, notes, and snippets.

View Raynos's full-sized avatar

Jake Verbaten Raynos

View GitHub Profile
@Raynos
Raynos / Friendly Links & Pro Tips
Created August 26, 2012 03:47 — forked from darkyen/Friendly Links & Pro Tips
JS Game Comp - Rules
@Raynos
Raynos / index.js
Created August 22, 2012 06:43
leaderboard
function LeaderBoard(doc) {
var elem = Fragment(html)
, leaderBoardElem = elem.querySelector(".leaderboard")
, playerSet = doc.createSet("type", "player")
, oldSelected = selected.get("player")
, sel = selectron()
playerSet.forEach(addPlayer)
playerSet.on("add", addPlayer)
@Raynos
Raynos / app.js
Created July 13, 2012 15:35 — forked from ralt/app.js
Trying to understand ncore...
var ncore = require( 'ncore' );
ncore.constructor( {
"other": {
"test": "test"
}
});
console.log( ncore );
@Raynos
Raynos / app.js
Created July 13, 2012 15:35 — forked from ralt/app.js
Trying to understand ncore...
var ncore = require( 'ncore' );
ncore.constructor( {
"./other.js": {
"test": "./test.js"
}
});
console.log( ncore );
@Raynos
Raynos / x.js
Created April 14, 2012 18:35
To-do application to-do item view implementation
/*
I herd u liek bloat and useless frameworks.
Just write JavaScript already
Uses [DelegateListener][1] and [fragment][2]
[1]: https://github.com/termi/DelegateListener
[2]: https://github.com/Raynos/fragment
*/
@Raynos
Raynos / class.js
Created March 21, 2012 18:44 — forked from rauschma/class.js
A minimal class proposal for ECMAScript.next
// Roughly: a combination of Jeremy’s and Allen’s ideas, updated with the results of recent discussions
// Guidelines:
// - Don’t use the same syntax as for object literals, but stay close.
// - Rationale: Some object literal features are forbidden in class declarations => don’t confuse people
// - Rationale: Comma separation is a bit tricky.
// - Keep new features at a minimum
// - Don’t obscure the fact that private names are actually name objects.
// => They can also be imported from somewhere else – a use case that needs to be supported.
// - In order to minimize confusion, keep module syntax and class declaration syntax similar.
@Raynos
Raynos / gist:1678976
Created January 25, 2012 21:42 — forked from Zirak/gist:1677020
Visibility API
//http://www.w3.org/TR/2011/WD-page-visibility-20110602/
(function () {
"use strict";
//no need to shim if it's already there
if ( 'hidden' in document && 'onvisibilitychange' in document ) {
return;
}
//fail silently if the browser sux
@Raynos
Raynos / gist:1677639
Created January 25, 2012 18:05 — forked from Zirak/gist:1677020
Visibility API
// assumes an ES5 compliant browser for Array.prototype.forEach
// and Object.defineProperty
// and a sane browser for Element.prototype.addEventListener
(function () {
"use strict";
//no need to shim if it's already there
if ( 'hidden' in document && 'onvisibilitychange' in document ) {
return;
}
@Raynos
Raynos / old.js
Created January 24, 2012 18:28 — forked from Zirak/a.js
ol reverse attribute polyfill
//use this if you want support for browsers which don't have ES5 goodies
(function () {
"use strict";
var lists = document.getElementsByTagName( 'ol' ), list;
for ( var i = 0, len = lists.length; i < len; i++ ) {
// bug 1 not local variable
list = lists[i];
@Raynos
Raynos / weak-map.js
Last active September 18, 2019 07:49 — forked from Gozala/weak-map.js
Harmony WeakMap shim for ES5
// Original - @Gozola. This is a reimplemented version (with a few bug fixes).
window.WeakMap = window.WeakMap || (function () {
var privates = Name()
return {
get: function (key, fallback) {
var store = privates(key)
return store.hasOwnProperty("value") ?
store.value : fallback
},