Skip to content

Instantly share code, notes, and snippets.

@webcracy
webcracy / defaults.css
Created August 18, 2010 00:44
Styles for simple FamFamFam icons
/* Styles for p, div or span with nice FamFamFam icons, to use around a link*/
.add {font-size: 12px; background: url('/images/icons/add.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;}
.new_password {font-size: 12px; background: url('/images/icons/lock_go.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;}
.ok {font-size: 12px; background: url('/images/icons/accept.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;}
.edit {font-size: 12px; background: url('/images/icons/pencil.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;}
.delete {font-size: 12px; background: url('/images/icons/delete.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;}
.show {font-size: 12px; background: url('/images/icons/magnifier.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;}
@webcracy
webcracy / ss
Created March 22, 2010 15:58
ss is a ./script/server shortcut
#!/usr/local/bin/ruby
#
# Name: ss
# Description: ss is a ./script/server shortcut
# Author: Alex Solleiro <[email protected]>
# Instructions:
# Save this file as 'ss' within a directory in your $PATH
# Make it executable, ex: 'chmod +x ss'
# Type 'ss' at the root of a Rails app to run './script/server'
# You can pass arguments in the usual way
@webcracy
webcracy / wordpress2tumblr.rb
Created September 26, 2009 17:51
A script to import your Wordpress posts on Tumblr
# Export your Wordpress posts to Tumblr (also allows to delete some.)
# Author: Alexandre Solleiro <[email protected]>
# How-to:
# 1. Export your Wordpress posts (http://en.blog.wordpress.com/2006/06/12/xml-import-export/)
# 2. Edit the information below to match your settings
# 3. To import, type "ruby wordpress2tumblr.rb --run" in the command line
# 4. To delete some posts, type "ruby wordpress2tumblr.rb --delete 1,2,3,4" where 1,2,3,4 are post numbers. (Be careful not to use spaces between IDs)
# Edit these
WP_EXPORT_PATH = "./wordpress.2009-09-14.xml" # path to the Wordpress Export file
@webcracy
webcracy / gist:191254
Created September 22, 2009 17:37
Polling of TVI.pt latest videos
# Stupid polling of TVI.pt latest videos
# Also tries to match a string to test for specific videos
# If true, it sends a Growl notification and outputs the video title to STDOUT
require 'rubygems'
require 'open-uri'
require 'cgi'
require 'hpricot'
require 'ruby-growl'
def index
@${1:things} = ${2:Thing}.find :all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @$1 }
end
end
def show