Skip to content

Instantly share code, notes, and snippets.

View andyferra's full-sized avatar

Andy Ferra andyferra

View GitHub Profile
No tests matched config/initializers/load_app_config.rb
No tests matched spec/controllers/sessions_controller_spec.rb
No tests matched spec/helpers/sessions_helper_spec.rb
No tests matched spec/models/comment_spec.rb
No tests matched spec/spec_helper.rb
No tests matched config/app_config.yml
No tests matched config/initializers/new_rails_defaults.rb
No tests matched lib/tasks/rspec.rake
No tests matched config/locales/en.yml
No tests matched spec/fixtures/comments.yml
## 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
(*
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
$ cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote git@github.com:andyferra/piggyback-savings.git master"
* executing "git clone -q git@github.com:andyferra/piggyback-savings.git /var/www/apps/piggybacksavings.com/releases/20090305184815 && cd /var/www/apps/piggybacksavings.com/releases/20090305184815 && git checkout -q -b deploy 0f8c9391ccf3c9630e7115df965152ac54a2291f && (echo 0f8c9391ccf3c9630e7115df965152ac54a2291f > /var/www/apps/piggybacksavings.com/releases/20090305184815/REVISION)"
servers: ["209.20.75.75"]
[209.20.75.75] executing command
** [209.20.75.75 :: out] Permission denied (publickey).