Skip to content

Instantly share code, notes, and snippets.

View rafiamafia's full-sized avatar

Rafia Qutab rafiamafia

  • NASA Jet Propulsion Laboratory
  • Los Angeles, CA
View GitHub Profile
@rafiamafia
rafiamafia / ruby_conf_2014.md
Last active August 29, 2015 14:09
Ruby Conf San Diego 2014

#Day 1

Matz Keynote

Static Type vs. Dynamic Type.

  • Static Typing is against DRY.
  • Soft typing:
    • Type is represented by set of methods e.g name and # of arguments
    • Class (as set of methods)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
@rafiamafia
rafiamafia / ttt.rb
Created September 14, 2012 16:01 — forked from JoshCheek/ttt.rb
Tic Tac Toe - procedural with few abstractions, ~110 loc
UNMARKED = ' '
def board_to_s board
board.each_slice(3).map { |a, b, c| " #{a} | #{b} | #{c} " }.join("\n---|---|---\n")
end
def display board, after_board = nil
puts board_to_s board
puts after_board if after_board
end