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
[alias] | |
co = checkout | |
put = push origin HEAD |
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
# Debugging limiting association joins for SQL Server Adapter. | |
Giving the following limiting SQL that would be normaly be generatd for the | |
test_eager_load_has_many_through_has_many(AssociationsJoinModelTest) case in | |
ActiveRecord for SQL Server. In this case the ORDER BY is totally moot. | |
SELECT DISTINCT TOP 1 [authors].id | |
FROM [authors] | |
LEFT OUTER JOIN [posts] ON ([authors].[id] = [posts].[author_id]) | |
LEFT OUTER JOIN [comments] ON ([comments].[post_id] = [posts].[id]) |
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
/* Here is the start of the assocaiation limiting SQL before needing limit/offset */ | |
SELECT [posts].id | |
FROM [posts] | |
LEFT OUTER JOIN [authors] ON [authors].id = [posts].author_id | |
WHERE (authors.name = 'David') | |
GROUP BY [posts].id | |
ORDER BY MIN(UPPER(posts.title)), MIN(posts.id) | |
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 'time' | |
puts "starting fibonacci" | |
def fib(num) | |
if(num < 2) | |
return 1 | |
else |
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 'yaml' | |
# When this file is loaded, for each data fixture file, a module is created within the DataFixtures module | |
# with the same name as the fixture file. For each fixture in that fixture file, a singleton method is | |
# added to the module with the name of the given fixture, returning the value of the fixture. | |
# | |
# For example: | |
# | |
# A fixture in <tt>int_live_data.yml</tt> named <tt>fix1_response_for_get_vin_parts</tt> with value | |
# <tt><foo>hi!</foo></tt> would be made available like so: |
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
(kencollins@station) - (~) Misc | |
-=>> sudo gem install rails-sqlserver-2000-2005-adapter | |
Successfully installed rails-sqlserver-2000-2005-adapter-2.2.9 | |
1 gem installed | |
Installing ri documentation for rails-sqlserver-2000-2005-adapter-2.2.9... | |
Installing RDoc documentation for rails-sqlserver-2000-2005-adapter-2.2.9... | |
(kencollins@station) - (~) Misc | |
-=>> sudo gem install rails-sqlserver-2000-2005-adapter |
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
a = if foo = nil # !> found = in conditional, should be == | |
'bar' | |
else | |
'none' | |
end | |
a # => "none" | |
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 | |
# Subversion Fame Report | |
# List the user and their number of commits. | |
require 'rubygems' | |
require 'activesupport' | |
log_xml = `svn log -q --xml` | |
svn_logs = XmlSimple.xml_in(log_xml)['logentry'] |
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 | |
APPS = ['Address Book','Calculator','Dictionary','DVD Player','Font Book','iCal','QuickTime Player','Safari'] | |
UTILS = ['Activity Monitor','Console','Disk Utility','Network Utility'] | |
def launch_app(app) | |
puts "Launch: #{app}" | |
`open /Applications/#{app.sub(' ','\ ')}.app` | |
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
module VersionedExtensions | |
def save_version? | |
false | |
end | |
def set_version(v) | |
self.version = v | |
update_without_callbacks | |
end |
OlderNewer