This file contains 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 show | |
if @project = @user.projects.find_by_name(params[:project_name]) | |
# congrats, it exists | |
elsif project = @user.projects.find_by_old_name(params[:project_name]) | |
redirect_to project_url(project), :status => :moved_permanently | |
end | |
end | |
This file contains 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 show | |
if @project = @user.projects.find_by_name(params[:project_name]) | |
# congrats, it exists | |
elsif project = @user.projects.find_by_old_name(params[:project_name]) | |
redirect_to project_url(project), :status => :moved_permanently | |
end | |
end | |
This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'daemons' | |
dir = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
daemon_options = { | |
:multiple => false, | |
:dir_mode => :normal, | |
:dir => File.join(dir, 'tmp', 'pids'), | |
:backtrace => true |
This file contains 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
#!/usr/bin/env ruby | |
require 'fileutils' | |
if ARGV.empty? | |
puts "Usage: #{__FILE__} <repository> <repository> ..." | |
exit -1 | |
end | |
created_flags = [] |
This file contains 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 'rubygems' | |
require 'activerecord' | |
require 'builder' | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'mysql', | |
:host => 'localhost', | |
:database => 'mephisto' | |
) | |
This file contains 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
--- makefile.osx.orig 2009-02-26 23:41:13.000000000 +0000 | |
+++ makefile.osx 2009-02-26 23:41:15.000000000 +0000 | |
@@ -3,7 +3,7 @@ | |
#CFLAGS=-Wall -DSLIMPROTO_DEBUG -D__BIG_ENDIAN__ | |
CFLAGS=-Wall -DSLIMPROTO_DEBUG | |
-INCLUDE=-Ilib/portaudio/pa_common -Ilib/portaudio/pablio -Ilib/portmixer/px_common -Isrc | |
+INCLUDE=-Ilib/portaudio/pa_common -Ilib/portaudio/pablio -Ilib/portmixer/px_common -Isrc -I/opt/local/include | |
PORTAUDIOFILES:=lib/portaudio/pa_mac_core/pa_mac_core.c lib/portaudio/pa_common/pa_lib.c lib/portaudio/pa_common/pa_convert.c lib/portaudio/pablio/ringbuffer.c |
This file contains 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
class Array | |
def move_to_front_of_line(x) | |
unshift(delete(self[x])) | |
end | |
end |
This file contains 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
class Tag | |
has_many :taggings | |
end | |
class Tagging | |
belongs_to :tag | |
belongs_to :posts | |
# uses a string 'flag' column but could be changed to a boolean important | |
# column later, hence the need to encapsulate! |
This file contains 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
From b7894c95720d13ec7d955fb3675294db5aedf987 Mon Sep 17 00:00:00 2001 | |
From: Luke Redpath <[email protected]> | |
Date: Fri, 27 Feb 2009 17:35:41 +0000 | |
Subject: [PATCH] Initial attempt at adding a :scope option to has_many :through. | |
This allows you to have has_many :through collections that go | |
through a named scope on your join model. This should make it | |
clearer: http://gist.github.com/71585 | |
--- | |
activerecord/lib/active_record/associations.rb | 3 ++- |
This file contains 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
RELEASE_OUTPUT_PATH = File.expand_path("~/Projects/releases/Squeemote") | |
TARGET_NAME = "Squeemote" | |
CONFIGURATION = ENV['CONFIGURATION'] || "Distribution" | |
SDK_VERSION = ENV['SDK'] || 'iphoneos2.2' | |
task :release do | |
puts "* Bumping build version." | |
`agvtool bump -all` | |
puts "* Building #{CONFIGURATION} release." |
OlderNewer