Skip to content

Instantly share code, notes, and snippets.

mklnz / flickr_image.rb
Created February 16, 2013 10:58
Modified flickr_image plugin with description and metadata
require "flickraw"
require "debugger"
class FlickrImage < Liquid::Tag
def initialize(tag_name, markup, tokens)
@markup = markup
@id = markup.split(" ")[0]
@size = markup.split(" ")[1]
@desc = markup.split(" ")[2]
mklnz / capistrano_sudo_helpers.rb
Created April 17, 2012 18:12
Sudo put and template methods for Capistrano
# I got tired of uploading to /tmp then moving to the correct location, so these two convenience methods will save you a lot of time in the long run.
# Helper method to upload to /tmp then use sudo to move to correct location.
def put_sudo(data, to)
filename = File.basename(to)
to_directory = File.dirname(to)
put data, "/tmp/#{filename}"
run "#{sudo} mv /tmp/#{filename} #{to_directory}"