This file contains 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 'httparty' | |
class GigJunkie | |
include HTTParty | |
base_uri 'http://api.gigjunkie.net/v1.0/' | |
# options - pageIndex, pageSize, latitude, longitude, distance, genre | |
SORT_BY = %w{date distance} | |
GENRES = %w{rock-pop country-folk rap-hip-hop jazz-blues world alternative-indie hard-rock-metal clubs-dance r-and-b-urban-soul tribute-bands} | |
This file contains 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
body = MultipartBody.new(:field1 => 'test', :field2 => 'test2') | |
http = EventMachine::HttpRequest.new('http://example.com').post( | |
:head => {'content-type' => "multipart/form-data; boundary=#{body.boundary}"}, | |
:body => body.to_s | |
) | |
# Or with a file part included | |
part1 = Part.new('name', 'content', 'file.txt') |
This file contains 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
watch (/(.*)(?:\.sass$|\.haml$|\.erb$)/) do |filename| | |
puts "Changed: #{filename}" | |
system %q{osascript -e "tell application \"Google Chrome\" | |
tell active tab of first window | |
execute javascript \"window.location.reload()\" | |
end tell | |
end tell"} | |
end |
This file contains 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
=> [#<Point id: 15, podium_id: 34, value: 180, category: nil, target_type: nil, target_id: nil, log: "Manually granted", created_at: "2014-03-25 09:40:57", updated_at: "2014-03-25 09:40:57", uniq_context: nil, profile_id: nil>, #<Point id: 16, podium_id: 37, value: 215, category: nil, target_type: nil, target_id: nil, log: "Manually granted", created_at: "2014-03-25 09:40:57", updated_at: "2014-03-25 09:40:57", uniq_context: nil, profile_id: nil>, #<Point id: 17, podium_id: 41, value: 170, category: nil, target_type: nil, target_id: nil, log: "Manually granted", created_at: "2014-03-25 09:40:57", updated_at: "2014-03-25 09:40:57", uniq_context: nil, profile_id: nil>, #<Point id: 18, podium_id: 35, value: 205, category: nil, target_type: nil, target_id: nil, log: "Manually granted", created_at: "2014-03-25 09:40:57", updated_at: "2014-03-25 09:40:57", uniq_context: nil, profile_id: nil>, #<Point id: 19, podium_id: 39, value: 225, category: nil, target_type: nil, target_id: nil, log: "Manually granted", created |
This file contains 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
{ | |
"name": "Steve's Workout", | |
"moves": [ | |
{ | |
"title": "Warmup" | |
}, | |
{ | |
"title": "Muscle contraction" | |
}, | |
{ |
This file contains 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
--- | |
name: Steve's Workout | |
moves: | |
- title: Warmup | |
sets: 5 | |
reps: | |
count: 1 | |
time: 60 | |
weight: | |
- title: Quad Curl |