Skip to content
View events.js
* Dead-simple event handling polyfills. Based largely on
* IE-safe removeEventListener polyfill. Not exported to avoid bugs
* caused by wrapping the event handler in IE8.
* @param {Window|Document|HTMLElement} el Element to listen on
View v8-opt.js
// V8 initializes memory space for _x and _y
// in advance
function Klass1() {
this._x = null;
this._y = null;
var k1 = new Klass1()._x = 'hi';
function Klass2() {}
// dynamically defined property converts to a
View jshintrc-plus-grunt.js
'use strict';
module.exports = function (grunt) {
var jshintrc = grunt.file.readJSON('.jshintrc');
// super simple shallow copy/merge
function merge(o1, o2) {
var retVal = {}, i;
for (i in o1) {
View paginator.liquid
{% comment %}
Generate PURE Paginators in a Jekyll blog:
The `page_spread` determines how wide the paginator is; it's the
number of links on either side of the center link, so you'll end
up with a list of the following sizes:
View yui-async-multi-grunt.js
/*jshint node:true*/
module.exports = function(grunt) {
var Y = require("yui/promise"),
name = "...",
desc = "...",
defaultOptions = { /* */ };
function executeAsyncTask(resolve, reject, file, options) {
// this is where your business logic goes
// call `resolve` when the task is finished
View ios-linkfix.js
/*global YUI*/
* Prevents iOS from showing the URL bar for cancelled links
* @module ios-linkfix
* @requires base-build, event-touch, node-base, node-event-delegate, plugin
YUI.add("ios-linkfix", function (Y, NAME) {
var HREF = "href",
DATA = "data-" + NAME,
View viewport.html
This is the mobile viewport setting. iOS 5 has a bug that
does some goofy scaling when you rotate it unless you set
the max scale to 1. We could do a one-off for this,
but it doesn't seem worth it.
<meta id="meta-viewport" name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,maximum-scale=1">
View innocent.html
<div class="wrap">
<div class="bar">
<div class="foo">Text!</div>
handlebars $1 | java -jar ~/bin/yuicompressor.jar --type js -o ${1/.handlebars/.js}
Something went wrong with that request. Please try again.