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 f(i=1);return if i>100;s=(i%3==0?'Fizz':'')+(i%5==0?'Buzz' : '');puts(s.empty? ? i:s);f(i+1);end;f |
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
# "u" is an ActiveRecord::Base subclass | |
u.class.connection.instance_variable_get("@connection").instance_variable_get("@connection") |
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
diff --git a/lib/active_record/connection_adapters/jdbc_adapter.rb b/lib/active_record/connection_adapters/jdbc_adapter.rb | |
index b40a59e..e5cbd63 100644 | |
--- a/lib/active_record/connection_adapters/jdbc_adapter.rb | |
+++ b/lib/active_record/connection_adapters/jdbc_adapter.rb | |
@@ -374,15 +374,15 @@ module ActiveRecord | |
while resultset.next | |
index_name = resultset.get_string(Jdbc::IndexMetaData::INDEX_NAME) | |
next unless index_name | |
- index_name.downcase! | |
- column_name = resultset.get_string(Jdbc::IndexMetaData::COLUMN_NAME).downcase |
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/src/java/jdbc_adapter/RubyJdbcConnection.java | |
+++ b/src/java/jdbc_adapter/RubyJdbcConnection.java | |
@@ -804,7 +804,7 @@ public class RubyJdbcConnection extends RubyObject { | |
rs = metadata.getTables(catalog, realschema, realtablepat, types); | |
List arr = new ArrayList(); | |
while (rs.next()) { | |
- String name = rs.getString(3).toLowerCase(); | |
+ String name = caseConvertIdentifierForJdbc(metadata, rs.getString(3)); | |
// Handle stupid Oracle 10g RecycleBin feature | |
if (!isOracle || !name.startsWith("bin$")) { |
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
#! /bin/sh | |
# | |
# /etc/init.d/mountec2vol | |
# | |
# chkconfig: 234 20 50 | |
# description: Assigns an EC2 EBS Volume to a device and mounts the device | |
# | |
# To add this as a service run: | |
# /sbin/chkconfig --add mountec2vol | |
# |
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
java -cp ~/usr/local/btrace/build/btrace-client.jar:/usr/jdk/lib/tools.jar:jruby-complete-1.2.0.jar com.sun.btrace.compiler.Compiler spec/RubyClassHistogram.java |
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
# This is an example spec_config.rb that can be used to run sequel's | |
# integration tests. | |
# jars used to run the integration tests for sqlite and mysql | |
# | |
# commons-dbcp-1.2.2.jar | |
# commons-pool-1.4.jar | |
# fscontext.jar | |
# mysql-connector-java-5.0.5.jar | |
# providerutil.jar |
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 | |
find = ARGV[0] | |
replace = ARGV[1] | |
`ack '#{find}' -l`.split.each do |f| | |
`sed -i 's/#{find}/#{replace}/g' #{f}` | |
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
Pry.prompt[1] = proc {""} |
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
brew install https://raw.github.com/gist/1099830/02960cf13a1486f4c73972b707cd979ea0dfbbec/openvpn.rb --force |
OlderNewer