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 Player < ActiveRecord::Base | |
has_many :initiated_challenges, foreign_key: 'player_one_id', class_name: 'Challenge' | |
has_many :accepted_challenges, foreign_key: 'player_two_id', class_name: 'Challenge' | |
end | |
class Challenge < ActiveRecord::Base | |
belongs_to :player_one, class_name: 'Player' | |
belongs_to :player_two, class_name: 'Player' | |
has_many :games |
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
# This is just a few sed commands to pull out turbolinks if you don't want them. | |
# To use it, just pass this as the template to your rails new command, like this: | |
# $ rails new myapp -m /path/to/no-turbo.rb | |
run "sed '/turbo/d' < Gemfile > Gemfile.tmp && mv Gemfile.tmp Gemfile" | |
run "sed '/turbo/d' < app/assets/javascripts/application.js > app/assets/javascripts/application.tmp && mv app/assets/javascripts/application.tmp app/assets/javascripts/application.js" | |
run "sed 's/, \"data-turbolinks-track\" => true//' < app/views/layouts/application.html.erb > app/views/layouts/application.html.tmp && mv app/views/layouts/application.html.tmp app/views/layouts/application.html.erb" |
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 Converter | |
def initialize(input) | |
@input = input | |
end | |
def convert | |
"3 + 2" | |
end | |
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
aac5657 Bump version for rubygems release | |
7184331 Merge pull request #183 from AutoUncle/nokogiri-update | |
0bcaa91 sax-machine 0.2.1 dependency | |
9b0bd4d Updated Nokogiri to 1.6.0 - temporary hack of sax-machine dependency necessary | |
87b1bb1 removed git reference | |
d8a5823 bumping nokogiri version | |
80cd357 Merge pull request #117 from compressed/upstream | |
1e37df0 Merge pull request #122 from muffinista/master | |
c166e0f Merge feed order from #126 [close #126] | |
d30c412 Merge branch 'ezkl-itunes-parser' |
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 'feedzirra' | |
feed = Feedzirra::Feed.fetch_and_parse('http://www.economist.com/media/rss/economist.xml') | |
entries = feed.entries | |
curls = entries.map do |entry| | |
curl = `curl --head #{entry.enclosure_url}` | |
curl.split(/\r/).first | |
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
#!/usr/bin/env bash | |
remote="${1:-staging}" | |
capture() { | |
heroku pgbackups:capture --expire --remote $1 | |
} | |
url() { | |
heroku pgbackups:url --remote $1 | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>PainZones</title> | |
<link rel="stylesheet" media="all" href="/assets/application-7eadaa6a15e069d84c07540345524b0e.css" data-turbolinks-track="true" /> | |
<script src="/assets/application-9e487c229e80a9801080a510f15708b7.js" data-turbolinks-track="true"></script> | |
<meta name="csrf-param" content="authenticity_token" /> | |
<meta name="csrf-token" content="Y07y3+TVyGsxAF0zE8Cu6Uaz2zdpb1OWZdeEnJVGTV+m0skCNPNMuTUTutwiPBghO01l+r6AjD9n72RIGHtFHg==" /> | |
</head> | |
<body> |
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
Feedjira::Feed.add_common_feed_element("image") | |
feed = Feedjira::Feed.fetch_and_parse("http://cltampa.com/tampa/Rss.xml?section=2065818") | |
feed.image | |
# => http://cltampa.com/binary/9697/adminIcon_clTampa.jpg |
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
import UIKit | |
import ExternalAccessory | |
class ViewController: UIViewController, EAWiFiUnconfiguredAccessoryBrowserDelegate { | |
var accessoryBrowser: EAWiFiUnconfiguredAccessoryBrowser? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
accessoryBrowser = EAWiFiUnconfiguredAccessoryBrowser.init(delegate: self, queue: nil) | |
accessoryBrowser?.startSearchingForUnconfiguredAccessoriesMatchingPredicate(nil) |
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
urls = ["http://feedjira.com/blog/feed.xml", "http://jonallured.com/atom.xml"] | |
feeds = urls.map { |url| Feedjira::Feed.fetch_and_parse url } | |
feeds.map { |feed| feed.title } | |
# => ["Feedjira Blog", "Jon Allured"] |
OlderNewer