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
# users_controller.rb | |
@teams = cache_fetch("teams"){ | |
Team.find(:all) | |
} |
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
curl -d "game_id=107763&access_token=YOUR_ACCESS_TOKEN" https://api.fanvibe.com/v1/checkin |
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
[{"checkin":{"id":9021,"game_id":107763,"user_id":1018}}] |
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
<div id="olark-data"><a class="olark-key" id="YOUR_OLARK_KEY" title="Powered by Olark" href="http://olark.com/about" rel="nofollow">Powered by Olark</a></div> |
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
<head> | |
<!-- ... other head code here --> | |
<%= yield :javascript_include_tags %> | |
<%= render :partial => '/shared/olark_script' %> | |
</head> | |
<body> | |
<!-- ... body code here --> | |
<%= render :partial => '/shared/olark' %> | |
</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
## fixes mobile_fu :mobile formats with restful_authentication | |
def access_denied | |
respond_to do |format| | |
# format.html do # this will not work with mobile_fu | |
format.any(:html, :mobile) do | |
store_location | |
redirect_to login_path | |
end | |
format.any(:json, :xml) do |
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
mislav-will_paginate -s http://gems.github.com | |
libxml-ruby | |
rest-client -s http://gems.github.com | |
plist | |
aws-s3 | |
htmlentities | |
paperclip | |
wireframe-apn_on_rails | |
configatron | |
geokit |
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 SampleJob | |
def perform | |
begin | |
# do all your work in the begin block. | |
puts "hello world" | |
rescue Exception => e | |
# rescue any errors so that you know something went wrong. Email yourself the error if you need. | |
error_msg = "#{Time.now} ERROR (SampleJob#perform): #{e.message} - (#{e.class})\n#{(e.backtrace or []).join("\n")}" | |
puts error_msg | |
ensure |
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
# these lines of code does not take into account a facebook token if the user is already connected | |
elsif current_user | |
current_user.authentications.create!(:provider => omniauth['provider'], :uid => omniauth['uid']) | |
flash[:notice] = "Authentication successful." | |
redirect_to authentications_url |
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
elsif current_user | |
current_user.apply_omniauth!(omniauth) | |
flash[:notice] = "Authentication successful." | |
redirect_to authentications_url |