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 = ChunkyPNG::Canvas.new 1200, 900, bg_color
i = 0
while i < 100
View representing_nouns.md

Notes From "Representing Nouns" class

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

Lesson Plan: representing_nouns.md

What are directories?

View happy
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'],
View jar_classes.sh
#!/bin/bash
# Pic of output at https://twitter.com/josh_cheek/status/693598961026793472
jarfile="$1"
if test -z "$jarfile"
then
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
end
def practice(topic_difficulty, time)
View why_vim.md

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)

Premises

  • 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
View cheating_at_drawful.md

Video of this code being run: https://vimeo.com/152923160/settings


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.