This file contains hidden or 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
<component name="libraryTable"> | |
<library name="libs"> | |
<CLASSES> | |
<root url="jar://$PROJECT_DIR$/libs/android-support-v4.jar!/" /> | |
<root url="jar://$PROJECT_DIR$/libs/androidannotations-api-2.7.1.jar!/" /> | |
<root url="jar://$PROJECT_DIR$/libs/acra-4.5.0.jar!/" /> | |
</CLASSES> | |
<JAVADOC /> | |
<SOURCES> | |
<root url="file://$PROJECT_DIR$/libs/google-play-services_lib/gen" /> |
This file contains hidden or 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
--- | |
http_interactions: | |
- request: | |
method: get | |
uri: https://api.twitter.com/1.1/account/verify_credentials.json | |
body: | |
encoding: US-ASCII | |
string: "" | |
headers: | |
Accept: |
This file contains hidden or 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 "figaro" | |
gem_group :development do | |
gem "guard" | |
gem "guard-rspec" | |
gem "guard-livereload" | |
end | |
gem_group :test do | |
gem "shoulda-matchers" |
This file contains hidden or 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
module Magic | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def method_added(name) | |
puts "instance method '#{name}' added" | |
end | |
def singleton_method_added(name) |
This file contains hidden or 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 'airbrake' | |
require 'debugger' | |
module Craigslist | |
module Scraper | |
MAX_DEPTH = (Rails.env.development? or Rails.env.test?) ? 1 : 5 | |
def self.scrape_category(category) | |
agent = Mechanize.new { |settings| | |
settings.user_agent_alias = "Linux Firefox" |
This file contains hidden or 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 EmailValidator < ActiveModel::Validator | |
EMAIL_ADDRESS_QTEXT = Regexp.new '[^\\x0d\\x22\\x5c\\x80-\\xff]', nil, 'n' | |
EMAIL_ADDRESS_DTEXT = Regexp.new '[^\\x0d\\x5b-\\x5d\\x80-\\xff]', nil, 'n' | |
EMAIL_ADDRESS_ATOM = Regexp.new '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+', nil, 'n' | |
EMAIL_ADDRESS_QUOTED_PAIR = Regexp.new '\\x5c[\\x00-\\x7f]', nil, 'n' | |
EMAIL_ADDRESS_DOMAIN_LITERAL = Regexp.new "\\x5b(?:#{EMAIL_ADDRESS_DTEXT}|#{EMAIL_ADDRESS_QUOTED_PAIR})*\\x5d", nil, 'n' | |
EMAIL_ADDRESS_QUOTED_STRING = Regexp.new "\\x22(?:#{EMAIL_ADDRESS_QTEXT}|#{EMAIL_ADDRESS_QUOTED_PAIR})*\\x22", nil, 'n' | |
EMAIL_ADDRESS_DOMAIN_REF = EMAIL_ADDRESS_ATOM | |
EMAIL_ADDRESS_SUB_DOMAIN = "(?:#{EMAIL_ADDRESS_DOMAIN_REF}|#{EMAIL_ADDRESS_DOMAIN_LITERAL})" | |
EMAIL_ADDRESS_WORD = "(?:#{EMAIL_ADDRESS_ATOM}|#{EMAIL_ADDRESS_QUOTED_STRING})" |
This file contains hidden or 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 VideoValiadtor < ActiveRecord::Validator | |
def validate(record) | |
# This regex will match YouTube and Vimeo videos | |
regex = /^http:\/\/(?:.*?)\.?(youtube|vimeo)\.com\/watch\?[^#]*v=(\w+)|(\d+)/ | |
# Use it as follows: | |
# | |
# "http://www.youtube.com/watch?v=AZDAIgwbXk4".match(regex) | |
# >> #<MatchData "http://www.youtube.com/watch?v=AZDAIgwbXk4" 1:"youtube" 2:"AZDAIgwbXk4" 3:nil> | |
# | |
# "http://vimeo.com/60555406".match(regex) |
This file contains hidden or 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 ruby | |
# | |
# Convert old jekyll release announcements to jekyll. | |
# | |
# Copies newly generated entries to `build/` | |
# | |
# 1. git clone git://github.com/ruboto/ruboto.wiki.git | |
# 2. cd ruboto.wiki | |
# 3. Run this script |
This file contains hidden or 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
pod 'SSPullToRefresh', {:git => '[email protected]:kennym/sspulltorefresh.git'} |
This file contains hidden or 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
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000 | |
dispatch_release(_animationSemaphore); | |
#endif |