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
{ | |
"api_servers":[ | |
{ | |
"url":"https://api.chinanetspeed.org/api", | |
"priority":1 | |
} | |
], | |
"metadata_servers":[ | |
{ | |
"url":"https://gist.github.com/mklnz/ce36e4500e6d6a2746de81f9009484b8", |
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 "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] |
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
# 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 |