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]) |
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
puts 'hello world.' |
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 github.gists | |
// @namespace http://mikedamage.github.com | |
// @description Adds a few site specific dock menu items to Github Gists. | |
// @include http://gist.github.com/* | |
// @author Mike Green | |
// ==/UserScript== | |
(function () { | |
if (window.fluid) { |
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
.external { | |
background: url(images/action_forward.gif) top right no-repeat; | |
padding-right: 20px; | |
} |
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
$(document).ready(function() { | |
// All our code goes here... | |
}); |
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
// Add icons to external links: | |
// the ^= means "match if the string starts with this" | |
$('a[href^="http://"]').addClass("external"); |