Skip to content

Instantly share code, notes, and snippets.

View natebird's full-sized avatar
🌐
Working online

Nate Bird natebird

🌐
Working online
View GitHub Profile
@natebird
natebird / Slicehost capistrano recipe
Created December 20, 2008 21:12
multi stage production recipe for slicehost
#############################################################
# Application
#############################################################
set :application, "app_name"
set :deploy_to, "/home/user/public_html/#{application}"
#############################################################
# Settings
#############################################################
<!--[if lte IE 7]>
<style type="text/css">
#ie6msg{border:3px solid #090; margin:8px 0; background:#cfc; color:#000;}
#ie6msg h4{margin:8px; padding:0;}
#ie6msg p{margin:8px; padding:0;}
#ie6msg p a.getie8{font-weight:bold; color:#006;}
#ie6msg p a.ie6expl{font-weight:normal; color:#006;}
</style>
<div id="ie6msg">
<h4>Did you know that your browser is out of date?</h4>
** Execute db:migrate
== AddPositionToEpisodes: migrating ==========================================
-- add_column(:episodes, :position, :integer, {:default=>0})
-> 0.0416s
rake aborted!
An error has occurred, this and all later migrations canceled:
undefined method `define_index' for #<Class:0x2b199d6b6a48>
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1964:in `method_missing_without_paginate'
/usr/lib/ruby/gems/1.8/gems/mislav-will_paginate-2.3.8/lib/will_paginate/finder.rb:168:in `method_missing'
.../config/preinitializer.rb:3: warning: already initialized constant APP_CONFIG
.../gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack.rb:17: warning: already initialized constant VERSION
Missing these required gems:
RedCloth >= 4.0
ryanb-acts-as-list
mislav-will_paginate
freelancing-god-thinking-sphinx
You're running:
ruby 1.8.6.286 at /opt/ruby-enterprise-1.8.6-20090201/bin/ruby
# download and git methods swiped from http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb
require 'open-uri'
def download(from, to = from.split("/").last)
#run "curl -s -L #{from} > #{to}"
file to, open(from).read
rescue
puts "Can't get #{from} - Internet down?"
exit!
# download, from_repo, and commit_state methods swiped from
# http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb
require 'open-uri'
def download(from, to = from.split("/").last)
#run "curl -s -L #{from} > #{to}"
file to, open(from).read
rescue
puts "Can't get #{from} - Internet down?"
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libvorbis configure 1.3.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/libvorbis/1.3.1
## --------- ##
@natebird
natebird / form_error_helper
Created November 13, 2010 19:55
Application helper to simplify the views in Rails3
# app/helpers/application_helper.rb
def form_errors(form)
if form.errors.any?
content_tag :h2, "#{pluralize(form.errors.count, 'error')} prohibited this #{form.class} from being saved:"
content_tag :ul
form.errors.full_messages.each do |msg|
content_tag :li, msg
end
end
end
@natebird
natebird / gist:738957
Created December 13, 2010 12:52 — forked from Arcath/gist:481321
def gravatar_url(email,options = {})
require 'digest/md5'
hash = Digest::MD5.hexdigest(email)
url = "http://www.gravatar.com/avatar/#{hash}"
options.each do |option|
option == options.first ? url+="?" : url+="&"
key = option[0].to_s
value = option[1].to_s
url+=key + "=" + value
end
@natebird
natebird / lockit.rb
Created March 2, 2011 19:28
authorization.rb
class Authorization
extend Lockdown::Access
#----------------------------------------------------------------------------
# Public
#----------------------------------------------------------------------------
# Access to all methods on the home controller
permission 'home'