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/bash | |
locate --null "*lib/modules/$(uname -r)*" | xargs -r0 sh -c 'for i do [ -d "$i" ] && printf "%s\n" "$i"; done' sh {} + | grep -v "^/lib/modules/$(uname -r)/kernel\|^/lib/modules/$(uname -r)$\|^/lib/modules/$(uname -r)/build$\|^/lib/modules/$(uname -r)/initrd$" | xargs ls |
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
# Pretty much all consumer lenses suffer from focus breathing at close distances, i.e the focal length changes. | |
# This lets us calculate the max focal length of a given lens at minimum focusing distance. | |
# | |
# Example 1: Nikon 70-200 f2.8 VR II - minimum focusing distance is 1.4m, max reproduction ratio is 0.12x. | |
# | |
# compute_focal_length 1400, 0.12 | |
# => 133.92857142857142 | |
# | |
# So at close distances, the Nikon isn't a 200mm lens, it's more like 135mm. | |
# |
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 WithTransaction | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Wrap the given method in a transaction. | |
def with_transaction(method_name) | |
define_method "#{method_name}_with_transaction" do |*args, &block| |
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
~$ export JRUBY_OPTS=--1.9; gem install json --debug -V | |
GET http://rubygems.org/latest_specs.4.8.gz | |
302 Found | |
GET http://production.s3.rubygems.org/latest_specs.4.8.gz | |
304 Not Modified | |
Installing gem json-1.5.3-java | |
ERROR: While executing gem ... (ArgumentError) | |
wrong number of arguments (2 for 1) | |
/home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:57:in `initialize' | |
/home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:64:in `each' |
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
~$ gem env | |
RubyGems Environment: | |
- RUBYGEMS VERSION: 1.8.8 | |
- RUBY VERSION: 1.9.2 (2011-07-07 patchlevel 136) [java] | |
- INSTALLATION DIRECTORY: /home/arthur/bin/jruby-1.6.3/lib/ruby/gems/1.9 | |
- RUBY EXECUTABLE: /home/arthur/bin/jruby/bin/jruby | |
- EXECUTABLE DIRECTORY: /home/arthur/bin/jruby/bin | |
- RUBYGEMS PLATFORMS: | |
- ruby | |
- universal-java-1.6 |