Skip to content

Instantly share code, notes, and snippets.

@GRMule
Created September 12, 2012 03:26
Show Gist options
  • Save GRMule/3704114 to your computer and use it in GitHub Desktop.
Save GRMule/3704114 to your computer and use it in GitHub Desktop.
blackCoffee, the newest javascript framework
/*
blackCoffee is the ultra-light, ultra-fast alternative to jQuery. Our slogan is:
--> Write the same amount, do an equal amount as you otherwise may have done
It isn't very catchy -- now taking suggestions for a better slogan!
*/
var blackCoffee = function (selector) {
if (typeof selector != 'string')
return null;
if (selector.match('#')){
return document.getElementById(
selector.replace('#', '')
);
}
return document.getElementsByClassName(
selector.replace('.', '')
);
};
var $ = blackCoffee;
// Try it here: http://jsfiddle.net/bM8c6/
@daviddesberg
Copy link

New slogan: "Has anyone really been far even as decided to use even go want to do look more like!?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment