Skip to content

Instantly share code, notes, and snippets.

View andyferra's full-sized avatar

Andy Ferra andyferra

View GitHub Profile
*** Exception SecurityError in spawn manager (Insecure operation - directory?) (process 745):
from /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/lib/passenger/application.rb:45:in `directory?'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/lib/passenger/application.rb:45:in `detect_framework_version'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:193:in `spawn_rails_application'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:126:in `spawn_application'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:251:in `handle_spawn_application'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:317:in `__send__'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:317:in `main_loop'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:168:in `start_synchronously'
from /opt/
## app/helpers/movies_helper.rb
module MoviesHelper
link_to_movie(movie)
case movie.type
when 'internal': internal_movie_link(movie)
when 'external': external_movie_link(movie)
else normal_movie_link(movie)
end
end
property dueTag : "due"
property startTag : "start"
property repeatTag : "repeat"
property todayTag : "today"
property pastDueTag : "overdue"
property upcomingTag : "upcoming"
property doneTag : "done"
property inProgressTag : "inprogress"
property errorTag : "error"
property removeTags : {upcomingTag, todayTag, pastDueTag, inProgressTag}
(*
A basic script for managing due dates.
*)
property dueTag : "due"
property repeatTag : "repeat"
property todayTag : "today"
property overdueTag : "overdue"
property upcomingTag : "upcoming"
property doneTag : "done"
@andyferra
andyferra / For That Matter.taskpapertheme
Created February 17, 2009 20:07
A minimal, focused theme for TaskPaper with extra styles for tasks tagged with @upcoming, @today, and @overdue
<theme>
<!-- For That Matter Theme for TaskPaper
by Andy Ferra (andyferra.com)
based on Dark Matter Theme -->
<!-- Colors -->
<color id="tag" red="0.1" green="0.1" blue="0.1" alpha="1.0" />
<color id="handle" red="0.25" green="0.25" blue="0.25" alpha="1.0" />
## example.rb
class Example
include Enumerable
@wrapped_array = ['something', 'foof']
end
e = Example.new
@andyferra
andyferra / gist:68269
Created February 22, 2009 00:53
prompt with git branch and working directory
## ~/git-ps1.rb
green = "\033[0;32m"
red = "\033[0;31m"
base = "\033[0;37m" # <-- Needs to be set to whatever your shell base colors is
current_branch = `git branch 2>/dev/null`.grep(/^\*/).first
if current_branch
branch_name = current_branch.gsub(/^\*\s*/,'').strip
color = branch_name =~ /master/ ? green : red
tell application "GrowlHelperApp"
-- Make a list of all the notification types
-- that this script will ever send:
set the allNotificationsList to ¬
{"Test Notification", "Another Test Notification"}
-- Make a list of the notifications
-- that will be enabled by default.
-- Those not enabled by default can be enabled later
-- in the 'Applications' tab of the growl prefpane.
class AddIndexesToUsers < ActiveRecord::Migration
def self.up
add_index :users, [:email, :account_id], :unique => true
end
def self.down
remove_index :users, :column => [:email, :account_id]
end
class AddIndexesToAccounts < ActiveRecord::Migration
def self.up
add_index :accounts, :domain_name, :unique => true
end
def self.down
remove_index :accounts, :column => :domain_name
end