Recent blog entries

17 May 2012 sjanes71   » (Journeyer)

An idiom for nesting anonymous functions in CoffeeScript

I have some code that is very brief, but called with a timeout. It’s tiresome to name two functions just so you can call them indirectly. Anonymous functions are quite brief in CoffeeScript:

setTimeout(
    () ->
        somethingThatCalls( () -> some other work here )
    , 1000)

You probably don’t want to go too many levels here, but its convenient for short bits of code.


Syndicated 2012-04-28 14:30:40 from sj4̄nz

17 May 2012 Kay   » (Journeyer)

Fixing JavaScript Console in older browsers and IE

The JavaScript console as introduced by Firebug years ago has grown to a de facto standard in many web browsers. Especially the Webkit JavaScript console in Chrome/Chromium and Safari is extremely well done. Newer Firefox versions now also come with a built-in console. Even Internet Explorer comes with a basic console-like thing but unfortunately it sucks...

So far I used custom logging mechanisms or log4javascript to log messages in my JavaScript applications. Thanks to the JavaScript console this would be unnecessary if all browsers had descent support for it. But unfortunately the console implementations in some browsers are incomplete or completely absent. So even this harmless line of code in your application can prevent execution in Internet Explorer when the development panel is closed (In which case window.console is not defined at all):

console.warn("Config not found. Using defaults.");

So to be able to use all console features without worrying about missing browser-support I wrote a small library called console-shim which detects the implemented console features and tries to complete them. Some features are emulated so they fully work in all browsers while other features are silently ignored. If console logging is not supported by the browser at all then console-shim tries to use log4javascript if available or it silently ignores all logging attempts. See the README for a full list of replacement implementations for missing functionality.

Syndicated 2012-05-17 13:11:19 from K's cluttered loft

17 May 2012 sjanes71   » (Journeyer)

“The fundamental rule of political analysis from the point of psychology is, follow the sacredness, and around it is a ring of motivated ignorance.”―Jonathan Haidt


Syndicated 2012-04-25 05:00:46 from sj4̄nz

17 May 2012 cdent   » (Master)

DataTables (table plug-in for jQuery)

DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement, which will add advanced interaction controls to any HTML table.
DataTables (table plug-in for jQuery)

prolly need this for some stuff

Syndicated 2012-05-17 10:52:35 from cdent

17 May 2012 sness   » (Journeyer)

Skrillex, Reviewed By Cute Kids - You Review #11 - YouTube

Skrillex, Reviewed By Cute Kids - You Review #11 - YouTube: "