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
>> Rails.cache.write('test-counter', 1) | |
=> true | |
>> Rails.cache.read('test-counter') | |
=> 1 | |
>> Rails.cache.read('test-counter') | |
=> 1 | |
>> Rails.cache.read('test-counter') | |
=> 1 | |
>> Rails.cache.read('test-counter') | |
=> 1 |
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
# app/models/util/cache.rb | |
class Util::Cache | |
def self.increment(key, amount = 1) | |
if (value = Rails.cache.read(key)).nil? | |
Rails.cache.write(key, (value = amount)) | |
else | |
Rails.cache.write(key, (value = value + amount)) | |
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
<!-- /dashboard/_container - This partial is used as a template --> | |
<table id="dashboard"> | |
<tr> | |
<td id="tabs"> | |
<!-- Links to different areas of the dashboard --> | |
</td> | |
<td id="main"> | |
<%= yield %> | |
</td> |
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 'open-uri' | |
namespace :parse do | |
task :teams => :environment do | |
api_key = '' | |
teams = Array.new | |
entry_names = Hash.new | |
entry_urls = Hash.new | |
(1..6).to_a.each do |page| |
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
[["201", "hurl", "http://hurl.r09.railsrumble.com"], ["734m", "LAZEROIDS!", "http://lazeroids.r09.railsrumble.com"], ["a-coders-diarrhea", "idealist", "http://idealist.r09.railsrumble.com"], ["aaron-longwell", "The Line Diet", "http://linediet.r09.railsrumble.com"], ["acts_as_ninjas", "Bartender Cocktail Recipies", "http://bartender.r09.railsrumble.com"], ["agile-bastards", "Everybody Loves Beer", "http://lovesbeer.r09.railsrumble.com"], ["agile-nomads", "PeepNote", "http://peepnote.r09.railsrumble.com"], ["agilitic-featuring-meboo", "PingMyRide", "http://agilitic.r09.railsrumble.com"], ["allcaps", "Decaf Sucks", "http://allcaps.r09.railsrumble.com"], ["andrew", "Rostered", "http://rostered.r09.railsrumble.com"], ["antga-me", "antga.me", "http://antgame.r09.railsrumble.com"], ["awesome", "Twt App", "http://valuable.r09.railsrumble.com"], ["bendyworks", "Yield the Floor", "http://yieldthefloor.r09.railsrumble.com"], ["big-bad-machine", "Twitter Competition Manager", "http://roundem.r09.railsrumble.com"], ["big |
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
# The following is taken from our application_controller.rb | |
before_filter :handle_facebook_requests | |
# Ensure Facebook requests are stateful by overwriting the session method | |
def session | |
if request_for_facebook? and !params[:_session_id].nil? | |
# TODO: Confirm _session_id is associated with the proper ip address | |
Rails.cache.fetch("sessions/#{params[:_session_id]}", :expires_in => 1.week) do |
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
def request_for_facebook? | |
# Until I escape Panera Bread hell | |
# (request.subdomains.first == 'web1' or request.subdomains.first == 'facebook') ? true : false | |
true | |
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
<!-- Automatically resize a textarea's height (like Facebook) --> | |
<textarea id="comment" rows="1" cols="50"></textarea> | |
<script type="text/javascript" charset="utf-8"> | |
function autoResize(fieldId) { | |
var length = $(fieldId).value.length; | |
if(length > 0) { | |
$(fieldId).rows = Math.floor(length / $(fieldId).cols) + 1; |
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
/* shrinkify google */ | |
input.lsb, input.gac_sb { | |
-webkit-appearance: push-button !important; | |
} | |
input.lst { | |
font-size: 13px !important; | |
} | |
table.gac_m { |
OlderNewer