Instantly share code, notes, and snippets.


Overcoming Stage Fright

  • Arrive early so you can become familiar with the space you'll be speaking in.
pbpaste | ruby -e 'puts "```"; puts; puts "```"' | pbcopy
View random_names.txt
Mary Townzen
Patricia Gooden
Linda Spinelli
Barbara Luth
Elizabeth Blackmon
Jennifer Vanness
Maria Aricas
Susan Stepro
Margaret Galbavy
Dorothy Faull
View temp.rb
class Mousetrap
attr_accessor :marble_count
def initialize(marble_count)
self.marble_count = marble_count
def press_button
print "presses the button which "
def flip_bucket
View temp.rb
class Recursor
attr_accessor :counter
def initialize
self.counter = 0
def a
return b + "a"
View simulate_typing_clipboard.txt
set mytext to (the clipboard as text)
on write_string(the_string)
tell application "System Events"
repeat with the_character in the_string
keystroke the_character
delay (random number from 0.05 to 0.25)

Here's a picture of Desert Golfing Hole 2866, which even the developer believed was impossible at first.

Desert Golfing Hole 2866

And here it is together with a picture of the following hole, 2867.

Desert Golfing Hole 2866 and 2867, stitched together

As you probably know, even though the next hole is off the screen and invisible, you can still bounce the ball off of its landscape features and back into the playfield. You can do a hail-Mary shot from the tee on 2866, aiming for the offscreen hill on the far side of the water hazard (which technically belongs to hole 2867). It will bounce off the hill and straight into the hole.

View skyrim_hearthfire.txt
Had one of the most intense experiences of my gaming career while playing
Skyrim. The Hearthfire expansion lets you build a house out in the country, and
also lets you adopt up to two orphaned children to live there. Your options for
interacting with the kids are pretty simple: "Go play outside," "I brought you
a present," "Time for bed," etc., but it's just enough to make you feel
responsible for their well being. So one day, I tell the kids to go play
outside while I'm working on remodeling the house. The afternoon slips by, and
I haven't heard a peep from the kids, so of course I feel compelled to step out
and check on them. They're just outside the front door. All seems well. Then I
round the corner, and staring straight back at me is a club-wielding giant.
View blog.rb
# Instead of loading all of Rails, load the
# particular Rails dependencies we need
require 'sqlite3'
require 'active_record'
# Set up a database that resides in RAM
adapter: 'sqlite3',
database: ':memory:'
View a_template.html.erb
<!-- NOTE this file must be saved under a folder named "a_subfolder"! -->
<h1><%= @a_variable.an_attribute %></h1>