This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://hachyderm.io/@mikeclark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Generates an edge-Rails application. | |
if [ $# -eq 0 ] | |
then | |
echo "usage: rails_edge <name>" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import List (..) | |
import Graphics.Element (..) | |
import Text (..) | |
import Html (..) | |
import Html.Attributes (..) | |
import Html.Events (..) | |
todos1 = ["A", "B", "C"] | |
todos2 = ["D", "E", "F"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Text (..) | |
import String (..) | |
import Color (..) | |
import Graphics.Element (..) | |
import Graphics.Collage (..) | |
greet name age = | |
plainText ("Hello, " ++ name ++ "! You don't look " ++ toString(age) ++ "!") | |
add x y = x + y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChangePerspective < ActiveRecord::Migration | |
def change | |
rename_table :users, :customers | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# API Documentation at http://api.wikia.com/wiki/LyricWiki_API | |
require 'open-uri' | |
require 'json' | |
require 'tmpdir' | |
ARTIST = "Johnny Cash" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Course < ActiveRecord::Base | |
def self.prototype(overrides={}) | |
attributes = { | |
:code => 'ruby', | |
:title => 'Ruby Programming', | |
:active => true, | |
:released_on => 15.days.ago | |
} | |
new(attributes.merge(overrides)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Run this inside TextMate using Cmd-R | |
# | |
# puts x | |
# | |
# Basically any error will trigger it. | |
/Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/catch_exception.rb:15:[BUG] Segmentation fault | |
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Toss this in your ~/.irbrc file for a convenient way | |
# to peruse Ruby source code in TextMate. This | |
# only works in Ruby 1.9! | |
# | |
# Use it in irb like so: | |
# | |
# >> require 'active_record' | |
# >> ActiveRecord::Base.source_for_method(:create) | |
class Object |
NewerOlder