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
require 'rubygems' | |
require 'open-uri' | |
require 'xml' | |
# Grab the raw XML from FriendFeed using open-uri | |
raw_xml = open("http://friendfeed.com/api/feed/user/simonstarr?format=xml").read | |
# Parse the XML with LibXml | |
# (this is where the magic happens) | |
source = XML::Parser.string(raw_xml) # source.class => LibXML::XML::Parser |
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/env ruby | |
# Basic titlebot for JsChat (http://jschat.org) | |
# Run 'gem install eventmachine' (with sudo if required) if your computer doesn't have it | |
# gem might also be gem1.8 if you got it from Debian/ubuntu | |
require 'rubygems' | |
require 'eventmachine' | |
require 'json' | |
require 'open-uri' |
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
# this goes in ~/.freeagent | |
ENV['FA_COMPANY'] = 'mycompany' | |
ENV['FA_USERNAME'] = 'myloginemail' | |
ENV['FA_PASSWORD'] = 'mypassword' |
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
<!-- Widescreen YouTube Embeds by Matthew Buchanan & Hayden Hunter | |
http://matthewbuchanan.name/451892574 | |
http://blog.haydenhunter.me | |
Hacked around by Simon Starr to break out of Tumblr's max width of 500px | |
http://www.simonstarr.com | |
Original source here: http://pastie.org/871790 | |
Released under a Creative Commons attribution license: |
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
# Use ImageMagick to get the dimensions of an image | |
def get_image_dimensions(image_url) | |
open(image_url, 'rb') do |f| | |
@image = Magick::Image.from_blob(f.read) | |
end | |
"width=\"#{@image.first.columns}\" height=\"#{@image.first.rows}\"" | |
end | |
# Insert the width and height into all img tags in a string | |
def insert_image_dimensions(string) |
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
source 'http://rubygems.org' | |
gem 'rails', '3.0.10' | |
# Authentication and authorisation | |
gem 'devise' | |
gem 'cancan' | |
# Attachments | |
gem 'carrierwave' |
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/env ruby | |
# | |
# Convert blogger (blogspot) posts to jekyll posts | |
# | |
# Basic Usage | |
# ----------- | |
# | |
# ./blogger_to_jekyll.rb feed_url | |
# | |
# where `feed_url` can have the following format: |
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/env bash | |
# Configuration | |
SERVER='10.20.30.40' | |
DEPLOY_TO='/Users/simon/apps/some_app/staging/' | |
EXCLUDE='*.sqlite3 *.swp .DS_Store .git/ tmp/ log/ public/uploads/ uploads/' | |
DRY_RUN=false | |
DEPLOY_GEM_PATH='/Users/simon/.rvm/gems/ruby-1.9.2-p180' | |
MYSQL2_BUNDLE='/Users/simon/apps/some_app/staging/vendor/bundle/ruby/1.9.1/gems/mysql2-0.2.13/lib/mysql2/mysql2.bundle' |
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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by configure, which was | |
generated by GNU Autoconf 2.68. Invocation command line was | |
$ ./configure --prefix=/Users/simon/.rvm/rubies/ruby-1.9.3-p194 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/simon/.rvm/usr | |
## --------- ## | |
## Platform. ## |
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
{ | |
"auto_complete_commit_on_tab": true, | |
"auto_complete_with_fields": true, | |
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme", | |
"detect_slow_plugins": false, | |
"draw_white_space": "all", | |
"file_exclude_patterns": | |
[ | |
"*.pyc", | |
"*.pyo", |
OlderNewer