This file contains hidden or 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 'java' | |
| require 'java/bcpg-jdk16-146.jar' | |
| module MyProject | |
| def self.keys_dir | |
| @keys_dir ||= Bundler.root.join("config/pgp/") | |
| end | |
| module PGP | |
| java_import 'java.io.ByteArrayInputStream' |
This file contains hidden or 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 OurService | |
| def run_thrift_server | |
| handler = TcUser::Thrift::UserServiceHandler.new | |
| processor = TcUser::Thrift::UserService::Processor.new(handler) | |
| transport = ::Thrift::ServerSocket.new(port) | |
| t_factory = ::Thrift::BufferedTransportFactory.new | |
| @server = ::Thrift::MutexableThreadPoolServer.new(processor, transport, t_factory, nil, {:num => 20, :mutex => mutex}) | |
| info "Service '#{name}' started with Process ID #{$$}" |
This file contains hidden or 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 Ohm | |
| module Expiring | |
| def self.included(base) | |
| base.instance_exec { | |
| include InstanceMethods | |
| extend ClassMethods | |
| } | |
| end |
This file contains hidden or 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/local/share/workspace/honk$ irb | |
| 1.9.3p0 :001 > require 'digest/sha1' | |
| LoadError: dlopen(/Users/s/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.1.0/digest/sha1.bundle, 9): Symbol not found: _rb_Digest_SHA1_Finish | |
| Referenced from: /Users/s/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.1.0/digest/sha1.bundle | |
| Expected in: flat namespace | |
| in /Users/s/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.1.0/digest/sha1.bundle - /Users/s/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.1.0/digest/sha1.bundle | |
| from /Users/s/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' | |
| from /Users/s/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' | |
| from (irb):1 | |
| from /Users/s/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>' |
This file contains hidden or 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
| sgonyea@s:~/workspace/myproj$ gem install curb --version 0.7.15 | |
| Successfully installed cucumber-0.3.100 | |
| 1 gem installed | |
| sgonyea@s:~$ gem install encryptor | |
| Successfully installed dynamic_form-1.1.4 | |
| 1 gem installed | |
| sgonyea@s:~/workspace/myproj$ rvm use jruby@global |
This file contains hidden or 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 log_regex | |
| @log_regex ||= begin | |
| ip_regex = '(?:\d+\.){3}\d+' | |
| log_regex = /^ | |
| (#{ip_regex})\s-\s-\s # IP | |
| \[(.*?)\]\s # Date | |
| "(.*?)"\s # Request | |
| (\d+)\s # Response Code | |
| (\d+)\s # Bytes Sent by Server | |
| ([\d\.]+)\s # Request Time |
This file contains hidden or 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 = (1..10).to_a | |
| # => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
| b = (11..20).to_a | |
| # => [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] | |
| [a,b].transpose.flatten | |
| # => [1, 11, 2, 12, 3, 13, 4, 14, 5, 15, 6, 16, 7, 17, 8, 18, 9, 19, 10, 20] |
This file contains hidden or 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
| describe "MTPS" do | |
| subject { Thrift::MutexableThreadPoolServer.new nil, nil } | |
| def Thread.block=(block); @block = block; end | |
| def Thread.block(&block) | |
| self.block = block if block_given? | |
| return(@block) | |
| end | |
| let(:server) { subject } |
This file contains hidden or 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
| Last login: Sun Jul 17 21:03:05 on ttys003 | |
| scott@mbp:~$ ds | |
| Using /Users/scott/.rvm/gems/ruby-1.9.2-p290 | |
| scott@mbp:~/Sites/my_project$ gem uninstall rake | |
| You have requested to uninstall the gem: | |
| rake-0.9.1 | |
| chunky_png-1.2.0 depends on [rake (>= 0)] | |
| factory_girl_rails-1.1.beta1 depends on [rake (>= 0)] |