Benjamin Fleischer bf4

View acts_as_slimgems.patch
1 2 3 4 5 6 7 8 9 10
diff --git a/Gemfile b/Gemfile
index 22bde6e..a429815 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,15 @@
source 'https://rubygems.org'
+require 'rubygems'
+def Gem.source_index
+ STDERR.puts "Guess who wants Gem.source_index? #{caller[0]}"
View colorize.rb
1 2 3 4 5 6 7 8 9 10
# see https://github.com/rubychan/coderay/blob/master/lib/coderay/encoders/terminal.rb
# https://rubygems.org/gems/text-highlight
module Colorize
ESCAPE_CODES_PATTERN = Regexp.new('\e\[(?:\d;)?\d{1,2}m')
module ColorCode
module_function
def color(name, background=false)
number = case name
when 'black' then 30
when 'red' then 31
View recruiter_wtf.txt
1 2 3 4 5 6 7 8 9 10
From: Eldrich_AikonTech eldrich@aikontechnologiesinc.com
Subject: Immediate Role: Ruby and Rail Developer - CA
 
I hope you are doing well. Just writing to check your availability for new project. I have an opportunity for you. Please have a look at it and let me know your interest with your latest resume and following details ASAP.
Full Name:
Contact No. :
Email ID:
Work authorization (H1B/GC/Citizen):
Current Location (City, State):
View rails32_http_patch_support.rb
1 2 3 4 5 6 7 8 9 10
# Rails 3.2 support for HTTP PATCH.
fail "Remove this patch" if Rails::VERSION::MAJOR > 3
# see http://weblog.rubyonrails.org/2012/2/26/edge-rails-patch-is-the-new-primary-http-method-for-updates/
# https://github.com/rails/rails/pull/505
 
# Be very conservative not to monkey-patch any methods until
# the relevant files are loaded.
ActiveSupport.on_load(:action_controller) do
ActionDispatch::Request.instance_eval do
# Is this a PATCH request?
View rails_engine_test.rb
1 2 3 4 5 6
include ActiveSupport
["app/**/", "lib/**/"].each do |glob|
Dir.glob(glob).each do |dir|
Dependencies.autoload_paths << File.join(File.dirname(__FILE__), dir)
end
end
View README.md

My script for pair sessions on my box.

What it does

  • downloads the appropriate ssh keys from github
  • copies the appropriate 'ssh pair@your-external-ip' command to your clipboard (see Note #1)
  • sets up the tmux session
  • cleans up the session, and the keys after it's done

How to use

View README.md

Benchmarking calls to /usr/bin/true on osx with ruby 1.9.3-p484 built on rvm

Calculating -------------------------------------
            backtick        56 i/100ms
              system        61 i/100ms
                open        59 i/100ms
             open |-        41 i/100ms
               open3        72 i/100ms
              thread        51 i/100ms
View config.ru
1
run -> (_) { [ 200, { 'Content-Type' => 'text/html', }, ['success'] ] }
View server.rb
1 2 3 4 5 6 7 8 9 10
require 'webrick'
 
server = WEBrick::HTTPServer.new :Port => 8000
 
server.mount_proc '/' do |req, res|
puts req.inspect
res.body = nil
end
 
trap 'INT' do server.shutdown end
Something went wrong with that request. Please try again.