This file contains hidden or 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
def is_paranoid opts = {} | |
# ...snip... | |
include InstanceMethods | |
end | |
module InstanceMethods | |
# snip snip snip | |
def destroy | |
# ....etc. | |
end |
This file contains hidden or 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 ActiveRecord::Base | |
is_paranoid | |
end |
This file contains hidden or 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
module Friendly | |
def greet | |
puts "Hello World!" | |
end | |
end | |
class HelloWorld | |
include Friendly | |
end |
This file contains hidden or 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 Thing | |
def do_something | |
puts "Doing something in Thing" | |
end | |
end | |
class SubThing < Thing | |
end |
This file contains hidden or 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 Thing | |
end | |
class SubThing < Thing | |
end | |
module IneffectiveOverride | |
end | |
Thing.send(:include, IneffectiveOverride) |
This file contains hidden or 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 A | |
end | |
class B < A | |
end | |
module X | |
end | |
A.send(:include, X) |
This file contains hidden or 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
select joy_journeys.id from joy_journeys, memberships, profiles, circles | |
INNER JOIN memberships on memberships.circle_id = circles.id | |
INNER JOIN profiles on memberships.profile_id = profiles.id | |
INNER JOIN joy_journeys on joy_journeys.profile_id = profiles.id | |
WHERE circles.id = #{self.id} |
This file contains hidden or 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
$ sudo gem search -r calendar_date_select | |
*** REMOTE GEMS *** | |
artmotion-calendar_date_select (1.10.9) | |
atd-calendar_date_select (1.15) | |
batasrki-calendar_date_select (1.13.3) | |
calendar_date_select (1.15) | |
DavidWhite-calendar_date_select (1.15.6) | |
edwinmoss-calendar_date_select (1.11.1) |
This file contains hidden or 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
require 'webrick' | |
class MyServlet < WEBrick::HTTPServlet::AbstractServlet | |
def do_GET(request, response) | |
response.body = "Whatever you want" | |
end | |
end | |
server = WEBrick::HTTPServer.new(:Port => 8082) | |
server.mount "/whatever", MyServlet |
This file contains hidden or 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
Bennett.get "/blog" do | |
"Hello World" | |
end | |
Bennett.get "/home" do | |
"<html><body><h1>Welcome to my home page!</h1> | |
Look at my <a href='/blog'>Blog</a>. | |
</body></html>" | |
end |