- Firefox
- Download Firefox
- Familiarize yourself with the Web Console.
- Chrome
- Download Chrome Canary
- Open "chrome://flags/", find "Enable Experimental JavaScript" and enable. Restart the browser
- Bookmarks
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); | |
} |
// 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. |
!!! 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') |
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", |
// Example | |
{ | |
let f = function() { | |
console.log( foo ); | |
}; | |
f(); | |
let foo = "foo!"; | |
} |