Skip to content

Instantly share code, notes, and snippets.

View ThisIsMissEm's full-sized avatar

Emelia Smith ThisIsMissEm

View GitHub Profile
def get_options(args)
options = {}
args.each {|arg|
arg.scan(/^(?:(?:|-)(?:-(no)?)?)-(\w+)(?:=(\w+))?$/) {|bool,key,value|
key = "no-"+key if !value.nil? && !bool.nil?
options[key] = value.nil? && bool.nil? || (value || bool.nil?)
}
}
options
end
// Set API key
var my_flickr = $.flickr({
apiKey: '123'
});
// Option 1: Inline callbacks
my_flickr.photos.getRecent({
size: 's'
page: 1,
beforeSend: function() {