I don't use my AppleTV and I've had a 500GB external HD sitting around that isn't really getting use either. I thought I'd make use of both of these things and see if I could turn my AppleTV into a NAS device that would also allow for BitTorrent downloading and act as a transcoding DLNA MediaServer that I could access from my Xbox 360 and/or PS3.
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
class User | |
attr_reader :item | |
def self.create(name) | |
User.new(TABLES['users'].items.create(id: name)) | |
end | |
def self.all | |
TABLES['users'].items.to_a.map{|i| User.new(i)} | |
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
class API < Grape::API | |
version '1' | |
end | |
Rack::Builder.new do | |
use Rack::Cors do |config| | |
config.allow do |allow| | |
allow.origins '*' | |
allow.resource '*', :headers => :any | |
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
Gemfile.lock |
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
Object.pathy! | |
def response | |
last_response.stub!(:parsed_body).and_return(MultiJson.decode(last_response.body)) | |
last_response | |
end | |
def body(path = nil) | |
if path | |
response.parsed_body.at_json_path(path) |
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
gem 'sinatra' | |
gem 'omniauth', '~> 1.0.0.alpha', :git => 'git://github.com/intridea/omniauth.git' | |
gem 'omniauth-oauth', '~> 1.0.0.alpha', :git => 'git://github.com/intridea/omniauth-oauth.git' | |
gem 'omniauth-contrib', '~> 1.0.0.alpha', :git => 'git://github.com/intridea/omniauth-contrib.git' |
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
GameRouter = new Backbone.Router.extend | |
routes: | |
"start": "start" | |
"draw": "draw" | |
start: -> | |
this.navigate('/draw') | |
draw: -> | |
$('#sketchpad .front > div').hide() | |
$('#draw').show() |
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
GameRouter = new Backbone.Router.extend | |
routes: | |
"start": "start" | |
"draw": "draw" | |
start: -> | |
this.navigate('/draw') | |
draw: -> | |
$('#sketchpad .front > div').hide() | |
$('#draw').show() |
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
# Data culled from Wikipedia. Could be cleaner, but this is nice and simple. | |
major_cities = [["New York", "New York"], ["Los Angeles", "California"], ["Chicago", "Illinois"], ["Houston", "Texas"], ["Philadelphia", "Pennsylvania"], ["Phoenix", "Arizona"], ["San Antonio", "Texas"], ["San Diego", "California"], ["Dallas", "Texas"], ["San Jose", "California"], ["Jacksonville", "Florida"], ["Indianapolis", "Indiana"], ["San Francisco", "California"], ["Austin", "Texas"], ["Columbus", "Ohio"], ["Fort Worth", "Texas"], ["Charlotte", "North Carolina"], ["Detroit", "Michigan"], ["El Paso", "Texas"], ["Memphis", "Tennessee"], ["Baltimore", "Maryland"], ["Boston", "Massachusetts"], ["Seattle", "Washington"], ["Washington", "District of Columbia"], ["Nashville", "Tennessee"], ["Denver", "Colorado"], ["Louisville", "Kentucky"], ["Milwaukee", "Wisconsin"], ["Portland", "Oregon"], ["Las Vegas", "Nevada"], ["Oklahoma City", "Oklahoma"], ["Albuquerque", "New Mexico"], ["Tucson", "Arizona"], ["Fresno", "California"], ["Sacrame |