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
context '#ban_devices' do | |
before :each do | |
@device1 = FactoryGirl.create(:device) | |
device2 = FactoryGirl.create(:device) | |
click1 = FactoryGirl.create(:click, :udid => @device1.id) | |
click2 = FactoryGirl.create(:click, :udid => device2.id) | |
notes = {'date' => '10/24/12', 'reason' => 'fraud'} | |
@click_hash = {click1.id => notes, click2.id => notes} | |
@num_banned = Utils.ban_devices(@click_hash) | |
end |
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 'oauth' | |
require 'launchy' | |
require 'nokogiri' | |
class User | |
def authenticate(consumer_key, consumer_secret, site) | |
consumer = OAuth::Consumer.new(consumer_key, consumer_secret, site) | |
request_token = consumer.get_request_token | |
puts "Authorize Follower and then paste in the PIN:" |
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 'rubygems' | |
require 'twitter' | |
require 'oauth' | |
consumer_key = "xxx" #Enter your key here | |
consumer_secret = "xxx" #Enter your secret here | |
oauth_consumer = OAuth::Consumer.new(consumer_key, consumer_secret, | |
:site => 'http://api.twitter.com', | |
:request_endpoint => 'http://api.twitter.com', |
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 Book | |
attr_accessor :title | |
def title | |
low_words = ['the', 'in', 'a', 'an', 'and' ] | |
array_words = @title.split | |
first_word = array_words[0].split(//) | |
first_word[0].upcase! | |
array_words[0] = first_word.join | |
joined_words = [] |