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
tell application "Finder" | |
set _b to bounds of window of desktop | |
set _w to item 3 of _b | |
set _h to item 4 of _b | |
end tell |
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
# This is how it would look using the Ruby Regexp class | |
# Only match one-line comments | |
@single_line_comments_pattern = Regexp.new(/\/\*.*?\*\//) | |
# Match single and multi-line comments | |
@all_comments_pattern = Regexp.new(/\/\*.*?\*\//m) |
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
/* BTJunkie Torrent Search */ | |
CmdUtils.CreateCommand({ | |
name: "btjunkie", | |
icon: "http://btjunkie.org/favicon.ico", | |
preview: "Search btjunkie.org for torrents", | |
author: { name: "Mike Green", email: "mike@fifthroomcreative.com" }, | |
license: "GPL", | |
takes: {"input": noun_arb_text}, | |
execute: function(input) { | |
Utils.openUrlInBrowser("http://btjunkie.org/search?q="+encodeURIComponent(input.text)); |
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
/* ColorSchemer Search */ | |
CmdUtils.CreateCommand({ | |
name: "color-schemer", | |
icon: "http://www.colorschemer.com/favicon.ico", | |
preview: "Search colorschemer.com for color schemes", | |
author: { name: "Mike Green", email: "mike.is.green@gmail.com" }, | |
license: "GNU GPL", | |
takes: {"input": noun_arb_text }, | |
execute: function(input) { | |
Utils.openUrlInBrowser("http://www.colorschemer.com/schemes/search.php?s="+encodeURIComponent(input.text)); |
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
/* Lifehacker Blog Search */ | |
CmdUtils.CreateCommand({ | |
name: "lifehacker", | |
icon: "http://lifehacker.com/favicon.ico", | |
preview: "Search Lifehacker blog articles", | |
author: { name: "Mike Green", email: "mike.is.green@gmail.com" }, | |
license: "GNU GPL", | |
takes: {"input": noun_arb_text}, | |
execute: function(input) { | |
Utils.openUrlInBrowser("http://lifehacker.com/search/"+encodeURIComponent(input.text)); |
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
$.ajax({ | |
dataType: 'jsonp', | |
data: { count: 3, callback: 'twitterFeed' }, | |
url: 'http://twitter.com/statuses/user_timeline/mikedamage.json', | |
jsonp: 'twitterFeed' | |
}); |
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 twitterFeed(feed) { | |
for (var i=0; i<feed.length; i++) { | |
$('#twitter-status ul').append('<li class="tweet">' | |
+ feed[i].text | |
+ '<br/><em>' | |
+ jQuery.timeago(parseDate(feed[i].created_at)) | |
+ '</em>' | |
+ '</li>'); | |
} | |
} |
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
require 'fileutils' | |
require 'tempfile' | |
module Webby | |
module Filters | |
# The Tidy filter is used to process HTML (or XHTML) through the _tidy_ | |
# program and outpu nicely formatted and correct HTML (or XHTML). | |
# | |
# Options can be passed to the _tidy_ program via the |
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
# = Sinatra Action: Minify Javascript | |
# | |
# == Summary | |
# Takes JS files from the public directory and minifies them using the JSMin Rubygem | |
get '/js/minify/:file' do | |
content_type 'text/javascript', :charset => 'utf-8' | |
@file = Pathname.new("./public/javascripts/" + params[:file]) | |
@mini = JSMin.minify(@file.read) | |
@mini |
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
# = Sinatra Action: Sass Stylesheet Compressor/Renderer | |
# | |
# == Summary | |
# Renders Sass stylesheets in the specified format. | |
# Valid formats are: extended, expanded, compact, compressed | |
get "/sass/:format/:file" do | |
content_type 'text/css', :charset => 'utf-8' | |
if params[:file] =~ /\.sass$/ | |
@file = Pathname.new("./views/sass/" + params[:file]) |