Skip to content

Instantly share code, notes, and snippets.

View tadman's full-sized avatar
🤔
Enumerating

Scott Tadman tadman

🤔
Enumerating
View GitHub Profile
10.print "HELLO WORLD"
20.goto 10
def pm(object)
identifiers = %w[ + - > ]
list =
case (object)
when Class:
puts "#{object} (Class)"
[
(object.methods.sort - Class.methods),
(object.private_methods.sort - Class.private_methods),
HTTP/1.0 500 Internal Server Error
Date: Mon, 02 Mar 2009 23:26:11 GMT
Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8e-fips-rhel5
Set-Cookie: PHPSESSID=98bef3ac7d4ff6ba2c97822d2de167ee; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: kaboom_playspacefinder=connect.kaboom.org%2C189.182.114.45%2C98bef3a
c7d4ff6ba2c97822d2de167ee; expires=Tue, 03-Mar-2009 00:26:11 GMT; domain=kaboom.
org
def pm(object)
identifiers = %w[ + - > # ]
list =
case (object)
when Class:
puts "#{object} (Class)"
[
(object.methods.sort - Class.methods),
(object.private_methods.sort - Class.private_methods),
#!/usr/bin/env ruby
class Array
def unique_by
inject(Hash.new(0)) do |h, i|
h[yield(i)] += 1
h
end.size == size
end
end
class Hash
def dig(*path)
path.inject(self) do |location, key|
location.respond_to?(:keys) ? location[key] : nil
end
end
end
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/environment'
conn = ActiveRecord::Base.connection
STDOUT.sync = true
while (true)
print "\e[;H"
class Multiplexer
instance_methods.each do |m|
undef_method m unless(m.match(/^__/))
end
def initialize(*objects)
@objects = objects
end
def method_missing(m, *args)
class ApplicationController < ActionController::Base
before_filter :set_time_zone
protected
# -- Page Title -----------------------------------------------------------
def page_title
@page_title ||= [ ]
end