This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Classify.js | |
* A simple implementation of a Class native in Javascript with support for private and public methods and properties. | |
* Inspired by MooTools Class.js and by the Module Javascript design pattern (for private and public methods and properties) | |
* | |
* Zohar Arad. February 2011 | |
* | |
* Usage: | |
* | |
* var MyClass = new Class({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
--- | |
source: http://gist.github.com/133677 | |
provides: document.write | |
description: MooTools based document.write replacement | |
requires: MooTools | |
author: Thomas Aylott -- SubtleGradient.com | |
thanks: Daniel Steigerwald -- daniel.steigerwald.cz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load live.js on local envs only | |
// Make sure the path is right and your dev env passes the test. | |
/* Delete these characters to disable it temporarily -> */ | |
(function() { | |
if(/^https?:\/\/(localhost|127.0.0.1)|^file:\/\/\//.test(document.location.href)) { | |
var live = document.createElement('script'); | |
live.src = 'js/live.js'; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(live, s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var _gaq=[['_setAccount','UA-XXXXXXXX-X'],['_trackPageview']]; | |
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; | |
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; | |
s.parentNode.insertBefore(g,s)}(document,'script')); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// warning - This gist is probably be 'too clever', and has two side effects which you might not want: | |
// - It doesn't queue alerts but silents them, so you may miss some calls | |
// - You might forget about it or another developer won't know about it, and won't have a clue why alert() calls don't work | |
(function(){ | |
window.debugMode = false; | |
if(/startdebug/.test(location.href)) document.cookie = 'debug=true'; | |
if(/stopdebug/.test(location.href)) document.cookie = 'debug=false'; | |
if(document.cookie.indexOf('debug=true') > -1) debugMode = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var settings = { | |
listLength: 30, | |
ignore: ['if', 'as', 'is', 'the', 'any', 'and', 'to', 'or', 'a', 'of'] | |
}, | |
w, s; | |
function getBodyText() { | |
var doc = document, | |
body = doc.body, | |
selection, range, bodyText; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/4545779 | |
"undefined"!=typeof console&&(console.lol=function(){var a=[].slice.call(arguments,0);a.unshift("LOL");a.push("LOLOLOL!");console.log.apply(console,a)}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// console.lol by @RonnyOrbach, idea by Erez Avny | |
if (typeof console != 'undefined') console.lol = function(){ | |
var args = [].slice.call(arguments, 0); | |
args.unshift("LOL"); | |
args.push("LOLOLOL!") | |
console.log.apply(console, args); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// getLargestYoutubeThumbnail by @ReallyGoodTeam, MIT | |
/* Sample youtube IDs | |
teYZM0Aft0A | |
wr1fa3ZaNYY | |
8e-BsJoaS20 - doesn't have maxresdefault | |
*/ |
OlderNewer