Skip to content

Instantly share code, notes, and snippets.

John Feminella fj

Block or report user

Report or block fj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:75040
From - Fri Mar 06 14:44:01 2009
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00800000
Message-ID: <>
Date: Fri, 06 Mar 2009 14:43:48 -0500
User-Agent: Thunderbird (X11/20090105)
MIME-Version: 1.0
View gist:75464
# Removes all Unicode BOMs from files and converts Windows CRLF to Unix LF.
find . -type f | \
while read line; \
do \
hd "$line" | grep -q 'ef bb bf' && echo "$line"; \
done | \
while read line; \
do \
echo [[[ $line; \
View gist:213403
[/tmp/tmp-dev]> git fetch
[/tmp/tmp-dev]> git config --add remote.origin.fetch refs/apple/banana
# ('apple' is a user I collaborate with who's got several branches, one of which is 'banana'.)
[/tmp/tmp-dev]> git fetch
From git@
* branch refs/apple/banana -> FETCH_HEAD
fj / hint.rb
Created Nov 25, 2009
Phone riddle for Karl Leswing. See karl.rb for more details.
View hint.rb
r:H@s;iirrrSS5SS52XXX9&i,,s3s;:::,,,r22XXsr;rrSSir;;::::::,,.,,,:;;;rrrrriSissSSXG; ,i@@@#@@@HG33hhhh&AAGA&
r;;9@MSrisiAHiiSissssii92;:,.;9s25r;rS2GG3X933hhXX33SSS;:;;::;ri33XSr;rrrrssssS2H2S@@#&,.. r@@@@@@@@@@@@@##
View merry-christmas.rb
# Merry Christmas!
OXZbW","-W[acg vsc*TZ`+eaaaaa--vucavuca+eadsvs+W[dgvrtc","-K991LIL77777dIIIII--
LKKILKKI+Mad[ ^U+K991LHJK"].map{|l|l.unpack("C*").map{|c|[(c/6-4)*12/7-8,"012
35b"[c%6,1]. hex]}*4};y=32.chr;l="@"+[(m="Jnx4sn3sgd1")+"vnqkc!6sgd2Lnqc4gz
r4bnld;6/Ld s2dzqsg6qd2@bdhud6gdq2Khmf;77/Lds2du4@dqx4gdzqs6oqd2@ozqd4ghl
4qnnl,+Amc 2gdz++2 @udm 4z mc 2gdz 4@+u dm 2zm
c2mz+@stqd+r hmf",m+"E zq sg !6sgd2Sz u4@h nt q4qd hfm r; 6/Ld
View ipad-user-agent-string.txt
Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10
View nano.rb
class Nanomachine
class Nanoparticle
def add(p)
while more?
p << self
# Ruby 1.9 includes nicer support for warnings that you didn't get in 1.8.
View const_resolver.rb
# Given a constant's name of the form r = "One::Two::[...]::ThirtyFive",
# resolve its value.
sep = "::" # Doesn't appear that '::' is defined.
c = r.split(sep).inject(Object) { |memo, el| memo.const_get(el) }
# Usage:
module Foo
module Bar
Baz = 100
View foo.markdown

I'm trying to be diligent about checking my rake tasks with RSpec tests, but in the process of feeling my way around I seem to have hit a wall. I've got a really simple RSpec test that looks like this:

# ./test/meta_spec.rb
describe "Rake tasks" do
  require 'rake'
  before(:each) do
    @rake =
    @rake.load_rakefile  # => Error here!
    Rake.application = @rake
We couldn’t find that file to show.
You can’t perform that action at this time.