Skip to content

Instantly share code, notes, and snippets.

View scsmith's full-sized avatar

Steve Smith scsmith

View GitHub Profile
@scsmith
scsmith / workout.yml
Last active March 20, 2022 22:00
Workout YAML
---
name: Steve's Workout
moves:
- title: Warmup
sets: 5
reps:
count: 1
time: 60
weight:
- title: Quad Curl
@scsmith
scsmith / workout.json
Last active May 24, 2021 11:16
workout.json
{
"name": "Steve's Workout",
"moves": [
{
"title": "Warmup"
},
{
"title": "Muscle contraction"
},
{
=> [#<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
@scsmith
scsmith / reload.watchr.rb
Created February 7, 2011 14:41
(I only added the .rb for syntax highlighting)
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
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')
@scsmith
scsmith / gist:436700
Created June 13, 2010 14:32
Real simple code to access the GigJunkie API from Ruby
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}