Skip to content

Instantly share code, notes, and snippets.

View raws's full-sized avatar
🥯
dabbling in pumpernickel

Ross Paffett raws

🥯
dabbling in pumpernickel
View GitHub Profile
module Wheaties
class User
include Comparable
attr_reader :hostmask, :modes
def initialize(args)
if args.is_a?(Hostmask)
@hostmask = args
@modes = Set.new
result = ["line one"]
result << "line two"
result << "line three"
#!/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
<?php
class Wiki extends Controller {
function Welcome()
{
parent::Controller();
}
function _remap($method)
<?php
$route["wiki/edit"] = "lorem/ipsum";
$route["wiki/delete"] = "dolor/sit/amet";
$route["wiki/(:any)"] = "wiki/view/$1";
?>
>> class C
>> def initialize(foo, bar)
>> puts foo.inspect
>> puts bar.inspect
>> end
>> end
=> nil
>> C.method(:initialize).arity
=> -1
require "hal"
Wheaties.register(Hal::Handler)
---
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!*@*
#!/usr/bin/env ruby
require "rubygems"
require "sinatra"
# 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