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
fj / bf.rb
Created Mar 18, 2014
Brainfuck interpreter in Ruby
View bf.rb
____[______[__]]=___[__];(__+=$_)==_____ ?____:_[]})[]}
___[_[__][$.]]=_[__][$_];(__+=$_)==____ ?___:_____[]})[]}
fj / gist:9691518
Last active Aug 29, 2015
"Your Mission", by Ellen M. H. Gates (1865)
View gist:9691518
If you cannot, on the ocean, sail among the swiftest fleet,
Rocking on the highest billows, laughing at the storms you meet,
You can stand among the sailors, anchored yet within the bay,
You can lend a hand to help them, as they launch their boats away.
If you are too weak to journey up the mountain steep and high,
You can stand within the valley, while the multitudes go by;
You can chant in happy measure, as they slowly pass along;
Though they may forget the singer, they will not forget the song.
View gist:11259853
def outer(&b)
foo = 1
def inner(v)
puts foo + v
# Is there a way to make 'foo' available in the scope of `inner`?
View gist:11260367
def with_model(m, &block)
w =
w.define_singleton_method :model do
w.instance_eval &block
def property(name)
puts model.to_s + name.to_s
View gist:11384481
require 'spec/environment_spec_helper'
describe 'UsersController' do
describe 'GET /new' do
it { expect(:get => '/users/new').to be_routable }
it {
get '/users/new'
expect(last_response.status).to eq 200
fj / game.rb
Created Jul 10, 2014
My work on the Uncle Bob bowling kata.
View game.rb
class Game
def roll(*pins)
(@rolls ||= []).push *pins
def score
def scores
View gist:62953162c079eeca30bb
Loaded in 1.3 seconds
/home/polytope/.local/share/Steam/SteamApps/common/Star Ruler 2/scripts/server/
Compiling void markDesignObsolete(Player&inout, const Design@, bool)
Error (302:5): Expression must be of boolean type
ERROR: Failed to build module 'empire' in manager 'server' (code -1).
ERROR: 'cheats': Cannot import function 'void setInstantColonize(bool)': module 'planets.SurfaceComponent' does not exist.
ERROR: 'empire_ai.EmpireAI': Cannot import function 'AIController@ createBasicAI()': module 'empire_ai.BasicAI' does not exist.
ERROR: 'orbitals': Cannot import function 'SystemDesc@ getSystem(Region@)': module 'game_start' does not exist.
ERROR: 'system_pathing': Cannot import function 'SystemDesc@ getSystem(uint)': module 'game_start' does not exist.
ERROR: 'system_pathing': Cannot import function 'SystemDesc@ getSystem(Region@)': module 'game_start' does not exist.
fj / gist:2900f29c6dc77d0e7c00
Last active Aug 29, 2015 — forked from cammckinnon/gist:2369233
View gist:2900f29c6dc77d0e7c00
fj / time.rb
Created Oct 31, 2014
perplexing round-trip Time instance behavior
View time.rb
t1 =
# => 2014-10-31 13:48:12 -0400
t2 =
# => 2014-10-31 13:48:12 -0400
# => [12, 48, 13, 31, 10, 2014, 5, 304, true, "EDT"]
fj / .rubocop.yml
Created Nov 5, 2014
UpHex's Rubocop and Rakefile
View .rubocop.yml
Max: 125
You can’t perform that action at this time.