Skip to content

Instantly share code, notes, and snippets.

View recruiter_wtf.txt
From: Eldrich_AikonTech
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):
bf4 / colorize.rb
Last active Aug 29, 2015
ansi terminal colorize
View colorize.rb
# see
module Colorize
ESCAPE_CODES_PATTERN ='\e\[(?:\d;)?\d{1,2}m')
module ColorCode
def color(name, background=false)
number = case name
when 'black' then 30
when 'red' then 31
View acts_as_slimgems.patch
diff --git a/Gemfile b/Gemfile
index 22bde6e..a429815 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,15 @@
source ''
+require 'rubygems'
+def Gem.source_index
+ STDERR.puts "Guess who wants Gem.source_index? #{caller[0]}"
bf4 / program.pdf
Last active Aug 29, 2015
RailsConf Program
View program.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
bf4 / decode_this.txt
Created Apr 20, 2014
crazy jobs postings
View decode_this.txt
Need highly skilled developers (Chicago)
Date: 2012-05-03, 4:52PM CDT
Reply to: see below
Too many unqualified candidates reply to our job postings, thus making the exceptional candidates hard to find. So, we've decided to raise the bar. We are looking for extraordinarily talented front-end developers (JavaScript/jQuery), Java Developers and Ruby on Rails developers. We provide credible access to many of the top tier interactive agencies, eCommerce companies, Financial firms, etc. in Chicago and nationwide. To apply for any of these positions you need to extract our contact info from the bottom of this ad. Once you decipher the code, send us a copy of your resume and we will contact you straight away. /* Must be authorized to work for any employer without restriction. No sponsorship. No telecommute */
bf4 / bench.rb
Last active Aug 29, 2015
Benchmarking to_s vs. &&=. Result: &&= is faster
View bench.rb
require 'benchmark/ips'
ENV = {}
Benchmark.ips do |x|"to_s, then to_s", "content_type = ENV['CONTENT_TYPE'].to_s.split(/\s*[;,]\s*/, 2).first.to_s.downcase")"to_s, then &&=", "content_type = ENV['CONTENT_TYPE'].to_s.split(/\s*[;,]\s*/, 2).first; content_type &&= content_type.downcase")"&&=, then &&=", "content_type = ENV['CONTENT_TYPE']; content_type &&= content_type.split(/\s*[;,]\s*/, 2).first; content_type &&= content_type.downcase")
bf4 / airbrake_client.rb
Created May 21, 2014
Airbrake client api
View airbrake_client.rb
#!/usr/bin/env ruby
#v3 api
bf4 /
Created May 28, 2014
passenger server starting script
#!/usr/bin/env bash
# ./serve setup
# ./ start
# with jruby, can't daemonize so
# ./ start jruby
# TODO see if instead of checking for $2
# we can check if $RUBY_VERSION matches jruby
if [ ! -n "$1" ]
echo "Usage: ./ [start|stop|restart|status|setup]"
bf4 / rails_background_sender.rb
Created Jun 22, 2014
Rails Mail background sender
View rails_background_sender.rb
module BackgroundSender
def self.serialize_mail(mail)
s = ""
# Mail#encoded strips bcc so we must add it manually
s << "Bcc: #{mail.bcc.join(", ")}\r\n" if mail.bcc.present?
s << mail.encoded
def self.deserialize_mail(serialized_mail)
bf4 /
Last active Aug 29, 2015
Bootstrap OSX Workstation Ruby/Homebrew/Git

Install as follows

\curl -sSL | \
  tar xzvf - --include '*setup' -O | bash