Skip to content

Instantly share code, notes, and snippets.

View rakeshpai's full-sized avatar

Rakesh Pai rakeshpai

View GitHub Profile
@rakeshpai
rakeshpai / better-self-executing-anon-function.js
Created January 9, 2012 09:02
A better self-executing anonymous function
(function(window, document, undefined) {
/*
Your code here
You can reference window, document and undefined as you normally do
*/
}(window, document))
@rakeshpai
rakeshpai / self-executing-anonymous-function.js
Created January 9, 2012 08:58
Self-executing anonymous function
(function() {
/* Your code here */
}())
@rakeshpai
rakeshpai / errorception-tracking-script-minified.html
Created August 15, 2011 16:20
Errorception tracking snippet - extra verbosity edition
<script>var _errs=["<application id here>"];(function(a,b){if(b.location.protocol!="https:"){a.onerror=function(a,c,b)
{_errs.push({m:a,u:c,l:b});return!1};var d=function(){var a=b.createElement("script"),
c=b.getElementsByTagName("script")[0];a.src="http://errorception.com/projects/"+_errs[0]+"/beacon.js";c.parentNode.insertBefore(a,c)};
a.addEventListener?a.addEventListener("load",d,!1):a.attachEvent("onload",d)}})(window,document);</script>
@rakeshpai
rakeshpai / gist:1094831
Created July 20, 2011 11:58
Variable shadowing in CoffeeScript, based on assignment scope
func = -> x = "some other string"
x = "some string"
func()
alert(x)