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' | |
module ItunesFeed | |
module Music | |
DEFAULT_FEED_TYPE = 'topalbums' | |
def music | |
@feed_type = ItunesFeed::Music::DEFAULT_FEED_TYPE | |
self |
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
Feature: Authentication | |
In order to attract interest and users to Futureish | |
As a product development team | |
I want users to login via twitter | |
So that they can create a Futureish account | |
Scenario: Authentication via Twitter | |
Given I am logged in on twitter | |
When I go to the homepage | |
And I follow "Login with Twitter" |
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
post_data = {} | |
post_data[:name] = 'Title for my link' | |
post_data[:link] = 'http://path.to/my/link' | |
post_data[:caption] = 'A caption' | |
post_data[:description] = 'A description' | |
post_data[:picture] = 'http://path.to/myimage.jpg' | |
post_data[:actions] = { :name => 'My site name', :link => 'http://link.to/my/site'}.to_json | |
client.post("feed", nil, post_data) |
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
source "http://rubygems.org" | |
gem 'tweetstream' | |
gem 'yajl-ruby' | |
gem 'growl' |
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 'rubygems' | |
gem 'httparty', '= 0.4.3' | |
require 'httparty' | |
require 'tinder' | |
require 'feedzirra' | |
require 'nokogiri' | |
current_woot = nil | |
woot_url = 'http://woot.com/Blog/Feed.ashx' |
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
if defined?(PhusionPassenger) | |
PhusionPassenger.on_event(:starting_worker_process) do |forked| | |
if forked | |
# We're in smart spawning mode. | |
Member.connection.reconnect! | |
Rails.cache.instance_variable_get(:@cache).quit if Rails.cache.class == ActiveSupport::Cache::LibmemcachedStore | |
else | |
# We're in conservative spawning mode. We don't need to do anything. | |
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
namespace :cache do | |
namespace :fragment do | |
desc 'Manually remove all fragment caches' | |
task :delete => :environment do | |
ActionController::Base.cache_store.clear | |
end | |
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
#!/usr/bin/env ruby | |
# Sets up remote tracking if you forgot to --track a branch, | |
# or if you're setting up a new branch. | |
# Save in ~/bin/ or somewhere else on your path. | |
# Usage: | |
# git track [[remote] branch] | |
# remote defaults to 'origin' | |
# branch defaults to the name of the current local branch |
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
if request.accept.include?('application/json') | |
content_type :json | |
else | |
content_type :text | |
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
# MongoMapper "embedded document delete" plugin | |
# By Peter Cooper | |
# | |
# Got embedded documents you want to delete? You can delete them as if the | |
# embedded document collection were an array, but then there's no way to get | |
# a callback (as far as I could tell). This plugin gives you a call back | |
# (if you want it) and gives a nicer syntax to deleting embedded docs. | |
# | |
# Example: | |
# |