Skip to content

Instantly share code, notes, and snippets.

{
"api_servers":[
{
"url":"https://api.chinanetspeed.org/api",
"priority":1
}
],
"metadata_servers":[
{
"url":"https://gist.github.com/mklnz/ce36e4500e6d6a2746de81f9009484b8",
@mklnz
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)
super
@markup = markup
@id = markup.split(" ")[0]
@size = markup.split(" ")[1]
@desc = markup.split(" ")[2]
@mklnz
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}"
end