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
-- A simple AppleScript to launch Last.fm.app and hide its window | |
tell application "Last.fm" to activate | |
tell application "System Events" to keystroke "w" using command down | |
tell application "Finder" to activate |
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
<!DOCTYPE html> | |
<!--[if lt IE 7 ]><html class="ie ie6 lte8 lte7 lte6" lang="en"><![endif]--> | |
<!--[if IE 7 ]><html class="ie ie7 lte8 lte7" lang="en"><![endif]--> | |
<!--[if IE 8 ]><html class="ie ie8 lte8" lang="en"><![endif]--> | |
<!--[if !IE]><!--><html lang="en"><!--<![endif]--> | |
<head> | |
<meta charset="utf-8" /> | |
<title></title> | |
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
<!DOCTYPE html> | |
<html lang="en" id="example-com"> | |
<head> | |
<meta charset="utf-8" /> | |
<title></title> | |
<link rel="profile" href="http://microformats.org/profile/hcard" /> | |
<link rel="stylesheet" media="screen" href="http://yui.yahooapis.com/3.1.1/build/cssreset/reset-min.css" /> | |
<link rel="stylesheet" media="screen" href="stylesheets/screen.css" /> |
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
/* | |
* Based on Paul Irish's "Markup-based unobtrusive comprehensive DOM-ready execution" | |
* http://paulirish.com/2009/markup-based-unobtrusive-comprehensive-dom-ready-execution/ | |
*/ | |
SITE_NAMESPACE = { | |
common: { | |
init: function() { | |
} |
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
javascript:(function() { | |
if ( !document.getElementById( "__grid" ) ) { | |
d = document.createElement( "div" ); | |
d.setAttribute( "id", "__grid" ); | |
d.setAttribute( "style", "background: url('http://" + window.location.hostname + "/images/grid.png') repeat-y 50% 0; height: " + document.height + "px; left: 0; position: absolute; top: 0; width: 100%; z-index: 16000000;" ); | |
document.body.appendChild( d ); | |
} else { | |
document.body.removeChild( document.getElementById( "__grid" ) ); | |
} |
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
// ==UserScript== | |
// @name Grid Helper | |
// @namespace http://sixtwothree.org | |
// @description Grid Helper adds a keyboard shortcut and grid image (located at ~/images/grid.png) | |
// @include * | |
// @author Grid Helper by Jason Garber (http://sixtwothree.org) | |
// ==/UserScript== | |
window.gridhelper = { | |
isCtrl: false, |
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
<form action="/path/to/some/action" method="post"> | |
<ul id="rating-list"> | |
<li class="average" style="width: 50px;"><span class="alt">2.5</span></li> | |
<%- (1..5).each do |score| -%> | |
<li class="rate-<%= score %>"><button type="submit" name="score" value="<%= score %>"><%= score %></button></li> | |
<%- end -%> | |
</ul> | |
</form> |
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
#!/bin/bash | |
############################################################ | |
# create-front-end-project.sh | |
# Builds a project directory based on the following pattern: | |
# | |
# /[target_directory] | |
# images/ | |
# content/ | |
# layout/ |
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
var date_utils = { | |
shift: function( date_obj, delta_in_days ) { | |
return new Date( date_obj.getTime() + ( delta_in_days * 86400000 ) ); | |
}, | |
epochTime: function( date_obj ) { | |
return date_obj.getTime(); | |
} | |
} |
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
// RegExplanation: Match last occurrence of "_<string>_" and replace with "_<new_string>_" | |
some_string.replace( /^(.*)_.+_(.*?)$/, "$1_" + new_fields_index + "_$2" ), | |
// RegExplanation: Match last occurrence of "][<string>][" and replace with "][<new_string>][" | |
some_string.replace( /^(.*)\]\[.+\]\[(.*?)$/, "$1\]\[" + new_fields_index + "\]\[$2" ) |
OlderNewer