Skip to content

Instantly share code, notes, and snippets.

/* CSS */
$height: 85px;
$width: 700px;
.container { position: relative }
.card {
height: $height;
width: $width;
z-index: 1;
# need to disable Rails.cache.fetch in test env
# and ActionController::Base.perform_caching doesnt do it
# from http://pivotallabs.com/users/spierson/blog/articles/818-standup-04-30-2009-perform-caching-and-rails-cache-w3c-dtds-and-ie-range-min-max
class BlackHoleStore
def logger
Rails.logger
end
def fetch( *args )
namespace :bundler do
task :install, :roles => :app, :except => { :no_release => true } do
run("gem install bundler --source=http://gemcutter.org")
end
task :symlink_vendor, :roles => :app, :except => { :no_release => true } do
shared_gems = File.join(shared_path, 'vendor/gems/ruby/1.8')
release_gems = "#{release_path}/vendor/gems/ruby/1.8"
# if you don't commit your cache, add cache to this list
%w(gems specifications).each do |sub_dir|
# you'd obviously have more settings somewhere
set :scm, :git
set :repository, "[email protected]:defunkt/github.git"
set :branch, "origin/master"
set :migrate_target, :current
set(:latest_release) { fetch(:current_path) }
set(:release_path) { fetch(:current_path) }
set(:current_release) { fetch(:current_path) }
# To demo in irb:
# load 'spinner.rb' ; include Spinner ; spinner_demo
#
# To use, include this module in a class and then wrap something in with_spinner
# It has two params, both optional. See spinner_demo for usage examples.
module Spinner
def with_spinner total=nil, message="Working...", &blk
current=0
shown=buildstr(message,current,total)
# Lo-fi client for the Facebook API. E.g.:
#
# fb = FacebookClient.new(:api_key => 'api-key', :secret => 'secret')
# fb.call 'users.getInfo', :session_key => 'session-key', :uids => 'user-id', :fields => 'birthday'
#
class FacebookClient
def initialize(default_params={})
@default_params = default_params.reverse_merge({
:rest_server => 'http://api.new.facebook.com/restserver.php',
:format => 'JSON',