Skip to content

Instantly share code, notes, and snippets.

View Raynos's full-sized avatar

Jake Verbaten Raynos

View GitHub Profile
head
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1")
title= title
link(rel='stylesheet', href='/public/js/libs/nodeunit/nodeunit.css')
script(src="/public/js/libs/nodeunit/nodeunit.js")
script(data-main="/public/js/app-test", src="/public/js/libs/require/require.js")
<!-- nodeunit HTML -->
@Raynos
Raynos / Cin.ui.Button.js
Created December 11, 2011 16:24
Cindela UI drafting, brainstorming
// Require the Cin app framework.
var EventPublisher = require('event::EventPublisher'),
Base = require('ui::Base');
var Button = Base.make(EventPublisher, {
enable: function _enable() {
// ...
this.emit('enabled');
}
});
@Raynos
Raynos / Cin.ui.Button.js
Created December 11, 2011 16:28
Cindela UI drafting, brainstorming
var EventPublisher = require('Cin.event.EventPublisher');
Base = require('Cin.ui.Base'),
extend = Object.extend;
let Button = Base <| extend(EventPublisher, {
enable() {
// ...
this.emit('enabled');
}
};
@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
},
@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 / 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 / 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 / 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 / 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 / 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 );