Skip to content
View calculator.rb
left = ARGV.shift.to_f
while 0 < ARGV.length
operator = ARGV.shift
right = ARGV.shift.to_f
if '+' == operator
left += right
elsif '-' == operator
left -= right
elsif '*' == operator
left *= right
View draw.rb
# if this fails, you can get it with `gem install chunky_png`
require 'chunky_png'
bg_color = ChunkyPNG::Color.rgb 100, 50, 0
line_color = ChunkyPNG::Color.rgb 150, 150, 200
canvas = 1200, 900, bg_color
i = 0
while i < 100

Notes From "Representing Nouns" class

aka "making sense of this topsy-turvy world" ;)~

Lesson Plan:

What are directories?

View happy
Personified syntax
nil = #
hash = @ key*value @
string = :delimiters)
boolean = true S, false$ , %% and ^^or
integer = V1 V2 all have Vs in front
View notes_from_representing_nouns.rb
# ----- Representing hashes with arrays -----
hash = {
'dog' => 'fighting',
'michael jordan' => 'jumping',
'army' => 'boxing'
array = [
['dog', 'fighting'],
# Pic of output at
if test -z "$jarfile"
echo "You must provide a jarfile as an argument" >&2
exit 1
elif test ! -f "$jarfile"
View effectiveness.rb
# Why a student should invest the time to become effective with their tools
class Student
attr_reader :learned, :effectiveness
def initialize(effectiveness)
@learned, @effectiveness = 1.0, effectiveness
def practice(topic_difficulty, time)

Why vim?

Why might it make sense to have students use vim? (tried to highlight the bits that lead me to conclude a console editor, to make it easier to skim, not to be all in-your-face or w/e :P)


  • Many things will be easier if they all use the same editor (though it's fine if they explicitly want to use a different one)
    • They can pair easier

Video of this code being run:

First, I would google for an image that represented what I had to draw. Then ran this code in pry to convert it into a set of x, y coordinates that should be dark:

require 'chunky_png'
canvas = ChunkyPNG::Canvas.from_file('scarface.png').grayscale
Something went wrong with that request. Please try again.