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
module Wheaties | |
class User | |
include Comparable | |
attr_reader :hostmask, :modes | |
def initialize(args) | |
if args.is_a?(Hostmask) | |
@hostmask = args | |
@modes = Set.new |
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
result = ["line one"] | |
result << "line two" | |
result << "line three" |
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 | |
require "rubygems" | |
require "summer" | |
class Bot < Summer::Connection | |
def channel_message(sender, channel, message) | |
return unless message =~ /^\.lmgtfy\s+(.+)$/i | |
privmsg "http://lmgtfy.com/?q=#{URI.escape($1)}", channel | |
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
<?php | |
class Wiki extends Controller { | |
function Welcome() | |
{ | |
parent::Controller(); | |
} | |
function _remap($method) |
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
<?php | |
$route["wiki/edit"] = "lorem/ipsum"; | |
$route["wiki/delete"] = "dolor/sit/amet"; | |
$route["wiki/(:any)"] = "wiki/view/$1"; | |
?> |
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 C | |
>> def initialize(foo, bar) | |
>> puts foo.inspect | |
>> puts bar.inspect | |
>> end | |
>> end | |
=> nil | |
>> C.method(:initialize).arity | |
=> -1 |
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
require "hal" | |
Wheaties.register(Hal::Handler) |
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
--- | |
brain: doolanshire | |
# The following two hashes are optional hostmask-based simple | |
# access control for who the brain learns from and who it will | |
# respond to: | |
converses: | |
only: | |
- Jesse!*@* | |
- Cidsa!*@* |
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 | |
require "rubygems" | |
require "sinatra" | |
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
# Instead of Capistrano running things like: | |
task :deploy do | |
servers.each { upload "foo", "bar" } | |
servers.each { run "rm -rf /" } | |
end | |
# do it like: | |
servers.each do |