This file contains hidden or 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
//works only with static urls, like /home.html, etc | |
function lockit(someActiveClass){ | |
var href = window.location.href | |
var split = href.split('/'); | |
if (split[split.length-1] == "") { | |
var urlend = split[split.length-2] | |
} else { | |
var urlend = split[split.length-1] | |
} |
This file contains hidden or 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
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.4.4",function($,L){$("<div class='vert'></div><div class='horz'></div>").appendTo("body");$(".vert").css({width:"1px",height:"100%",position:"fixed",top:"0px",left:"0px","background-color":"#232323"});$(".horz").css({height:"1px",width:"100%",top:"0px",left:"0px",position:"fixed","background-color":"#232323"});$("html").mousemove(function(a){$(".vert").css({left:a.pageX-$(window).scrollLeft()});$(".horz").css({top:a.pageY-$(window).scrollTop()})});}); |
This file contains hidden or 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
'#'+('00000'+(Math.random()*(1<<24)|0).toString(16)).slice(-6); |
This file contains hidden or 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
//utility for detecting links in text string | |
detectLinks(string, newtab){ | |
newtab = (newtab == undefined) ? true : newtab; | |
var regexp = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i; | |
return newtab ? string.replace(regexp, "<a href='$1' target='_blank'>$1</a>") : string.replace(regexp, "<a href='$1'>$1</a>"); | |
} |
This file contains hidden or 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 uniqRand(notThis, range){ | |
var maybe = Math.floor(Math.random() * range); | |
if (maybe !== notThis){ | |
return maybe; | |
} else { | |
return uniqRand(notThis, range); | |
} | |
} |
This file contains hidden or 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
// $.relativeTime - returns a string that tells how long ago the passed in string happened. For Twitter. | |
$.relativeTime = function(dateString) { | |
var rightNow = new Date(); | |
var then = new Date(dateString); | |
if ($.browser.msie) { | |
// IE can't parse these crazy Ruby dates | |
then = Date.parse(dateString.replace(/( \+)/, ' UTC$1')); | |
} | |
This file contains hidden or 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
// requires jQuery | |
$("h2").each(function(){ | |
var h2 = $(this); | |
var t = h2.text(); | |
var last = t.split("")[t.length-1]; | |
var newtext = t.substring(0,t.length-1) + "<span style='letter-spacing:0px;'>" + last + "</span>"; | |
h2.html(newtext); | |
}); |
This file contains hidden or 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
<doctype html> | |
<html> | |
<head> | |
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic' rel='stylesheet' type='text/css'> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<div id="container"> | |
<h1>The Fridge: A Startup Cultural Catalyst</h1> | |
<p>At Whiteboard, we are about culture. We're about family. We're about living <em>with</em> one another, as opposed to simply beside one another. For that reason, we recently took some time to create an internal tool.</p> |
This file contains hidden or 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
// From the 140bytes wishlist here: https://github.com/jed/140bytes/wiki/Wishlist | |
// TASK: | |
// Create a function which can create a DOM structure from this: | |
// | |
domBuilder( | |
[/HTML/], | |
[/HEAD/], | |
[/TITLE/], | |
"Wouldn't this be cool?", | |
[], |
This file contains hidden or 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
<div id="imageholder"> | |
<img src="http://3.bp.blogspot.com/-JlYXI_mJn7U/UFIJ7_8iLJI/AAAAAAAAAWY/ClZoftC59Uc/s1600/TheGobblingGluttons.jpg"> | |
<div id="glass"></div> | |
</div> |
OlderNewer