Skip to content

Instantly share code, notes, and snippets.

View practicingruby's full-sized avatar

Gregory Brown practicingruby

View GitHub Profile

This is my Manifesto!

A long winded philosophical statement that is meant to tug at the heart strings, but is still written in business speak suitable for someone staring off into the middle distance.

"A quote from someone notable for doing a thing a few decades ago" -- Some Dude

A sharp statement that really 'gets to the point' but doesn't really.

  • A list of things on the left that are established practices
  • A list of things on the right that are the same practices using new words
def computation(number)
raise "Amount cannot be negative" if number < 0
# do something here.
end
require "pdf/inspector" # gem install pdf-inspector
text = File.binread("2016WayneCountyTaxLiens.pdf")
text_analysis = PDF::Inspector::Text.analyze(text)
File.write("dump.txt", text_analysis.strings.join)
# For more, see https://github.com/prawnpdf/pdf-inspector
# and also https://github.com/yob/pdf-reader
#
class BrokenNumber
def initialize(num)
@num = num
end
def method_missing(m, *a, &b)
@num.send(m, *a, &b)
end
def coerce(other)
name weekday start finish
Gregory Monday 8:30 AM 4:30 PM
Gregory Tuesday 8:30 AM 4:30 PM
Gregory Thursday 8:30 AM 12:00 PM
Hunter Wednesday 10:00 AM 2:00 PM
Hunter Thursday 10:00 AM 2:00 PM
Hunter Friday 10:00 AM 4:00 PM

Immutable Rules

101: All players must always abide by all the rules then in effect, in the form in which they are then in effect. The rules in the Initial Set are in effect whenever a game begins. The Initial Set consists of Rules 101-116 (immutable) and 201-213 (mutable).

102: Initially rules in the 100's are immutable and rules in the 200's are mutable. Rules subsequently enacted or transmuted (that is, changed from immutable to mutable or vice versa) may be immutable or mutable regardless of their numbers, and rules in the Initial Set may be transmuted regardless of their numbers.

103: A rule-change is any of the following: (1) the enactment, repeal, or amendment of a mutable rule; (2) the enactment, repeal, or amendment of an amendment of a mutable rule; or (3) the transmutation of an immutable rule into a mutable rule or vice versa.

@practicingruby
practicingruby / articles.md
Last active September 16, 2015 01:17
A sampling of Practicing Ruby design articles

Mapping "learning code" guidelines to the Agile principles

Quotes are from agilemanifesto.org, rest is from Gregory Brown

Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.

As a learner, you need to start making use of what you learn as early as possible, and keep applying what you've learned, while keeping your goals focused on actually building useful things, rather than just treating coding as an intellectual exercise.

roster = Roster.new
data = PeopleService.fetch(some_search_params)
data.each do |person|
if roster.names.count < 10
roster.names << person.name
else
raise "You can't have a roster with more than 10 people on it"
end
end
roster = Roster.new
data = PeopleService.fetch(some_search_params)
data.each do |person|
roster.names << person.name
end
roster.style = :colorized
RosterPrintout.new(roster).generate_pdf("out.pdf")