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
// intercept rel=image clicks and make images fade in over the top | |
$$('a[rel=image]').each(function(link){ | |
link.observe('click',function(e){ | |
Event.stop(e); | |
i = new Element('img'); | |
i.observe('load',function(){ | |
$('image_mask').appear() | |
}) | |
// do this afterwards for IE | |
i.writeAttribute('src',$(this).readAttribute('href')); |
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
#! /usr/bin/ruby | |
n = 52 # size of deck | |
s = 8 # number of shuffles | |
cards = [] | |
n.times {|card| cards << card} | |
s.times do |shuffle| |
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
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.HashSet; | |
public class Textonyms { | |
/** | |
* Outputs any words from the System.in that could have been generated |
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
mail(:to => ....).dev_deliver('[email protected]') # will deliver through this mailer to '[email protected]' |
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
UseCanonicalName Off | |
VirtualDocumentRoot /Users/ben/Sites/%1 | |
<Directory /Users/ben/Sites> | |
Options SymLinksIfOwnerMatch | |
</Directory> |
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> | |
<script src="http://code.jquery.com/jquery-1.5.js"></script> | |
<style type="text/css" media="screen"> | |
body{font-family: Helvetica, sans-serif} | |
</style> | |
<script type="text/javascript" charset="utf-8"> | |
$(function(){ | |
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($){ | |
if(document.createElement().style.outline == undefined){ | |
/* | |
This requires the following lines in the document: | |
<style>v\: * { behavior:url(#default#VML);}</style> | |
<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" /> | |
*/ | |
$.cssHooks['outline'] = { |
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
/* | |
Usage: | |
t = timer(); | |
t('start') | |
…some slow script… | |
t('checkpoint'); | |
…some slow script… | |
list = t('checkpoint2'); |
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
# based on http://marsorange.com/archives/of-mogrify-ruby-tempfile-dynamic-class-definitions#comment-94 | |
# Monkey patch the temp file so that it maintains the extension | |
class Tempfile | |
def make_tmpname basename, n | |
sprintf('%s%d-%d%s', File::basename(basename, ext), $$, n, File::extname(basename)) | |
end | |
end |
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> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>timer</title> | |
<script type="text/javascript" charset="utf-8"> | |
;window.timer = function(){ |
OlderNewer