Skip to content

Instantly share code, notes, and snippets.

View christopherscott's full-sized avatar
👍
asdf

Christopher Scott Hernandez christopherscott

👍
asdf
View GitHub Profile
@rwaldron
rwaldron / future-js-preparation.md
Created January 22, 2013 15:45
Preparation notes for Boston JavaScript Meetup, January 22nd 2013

Prepare for Boston JavaScript Meet-up

  1. Firefox
  • Download Firefox
  • Familiarize yourself with the Web Console.
  1. Chrome
  • Download Chrome Canary
  • Open "chrome://flags/", find "Enable Experimental JavaScript" and enable. Restart the browser
  1. Bookmarks
// Example
{
let f = function() {
console.log( foo );
};
f();
let foo = "foo!";
}
if (typeof (AC) === "undefined") {
AC = {}
}
AC.ImageReplacer = Class.create({
_defaultOptions: {
listenToSwapView: true,
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i,
filenameInsert: "_☃x",
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i,
attribute: "data-hires",
@xtian
xtian / html5boilerplate.jade
Last active December 23, 2023 15:05
HTML5 Boilerplate in jade
!!! 5
html(class='no-js')
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
title
meta(name='description', content='')
meta(name='viewport', content='width=device-width, initial-scale=1')
@cowboy
cowboy / is-this-partial-application.js
Created September 16, 2010 20:26
Is this partial application? Currying? Something else? Vindaloo maybe?
// See my blog post:
// http://benalman.com/news/2010/09/partial-application-in-javascript/
// In the following code sample, invoking the curried function will always
// return a function until all arguments are satisfied, at which point the
// original function is invoked, returning its result. This means that all
// function arguments are required, which also allows the function to be
// called either like foo( 1, 2, 3 ) or foo( 1 )( 2 )( 3 ). This also means
// that if any argument is omitted, the original function is never invoked.
@dokipen
dokipen / prototype-pub-sub.js
Created April 26, 2010 16:16
Generic pub-sub in Prototype
PubSub = {
initPubSub: function() {
this._dummy = new Element('span');
},
fire: function(event, memo) {
this._dummy.fire(event, memo);
},
observe: function(event, handler) {
this._dummy.observe(event, handler);
}