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 CS5 | |
Pseudo_Classes = [ | |
/root/, | |
/nth\-child\((\d+n\+\d+|\d+|odd|even)\)/, | |
/nth\-last\-child\((\d+n\+\d+|\d+|odd|even)\)/, | |
/nth\-of\-type\((\d+n\+\d+|\d+|odd|even)\)/, | |
/nth\-last\-of\-type\((\d+n\+\d+|\d+|odd|even)\)/, | |
/first\-child/, | |
/last\-child/, | |
/first\-of\-type/, |
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 Object | |
def method_missing( _method, *arg) | |
_method = _method.to_sym | |
if (_method.to_s[_method.to_s.size - 1] == ?=) && ( arg[0].class == Proc) | |
target = (self.class == Class ? self : self.class) | |
target.class_eval do | |
define_method( _method.to_s[0, _method.to_s.size - 1].to_sym, arg[0].binding) | |
end | |
else | |
raise NoMethodError, "undefined method `#{_method}' for #{self.inspect}:#{self.class}", caller(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 Prototype | |
def new(member = {}, &block) | |
prototype(member || {}, self,&block) | |
end | |
def respond_to?(name) | |
return self if methods.include?(name.to_s) | |
__proto__ = @proto.respond_to?(name) | |
return __proto__ if __proto__ | |
false |
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
#!ruby path | |
ENV['GEM_HOME'] = "gem path" | |
require 'rubygems' | |
require 'cgi' | |
require 'RMagick' | |
require 'kconv' | |
print "Content-Type: text/html\n\n" |
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 Object | |
def self_methods | |
methods.map{|m| | |
m=method(m.to_sym) | |
(m.owner == self.class ? m.name : nil ) | |
}.compact | |
end | |
end | |
p ''.methods.sort |
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.class_eval do | |
undef :allocate | |
end | |
begin | |
p Class.new | |
rescue => e | |
p e | |
end | |
# => <Class:0x*******> |
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
#nil# Public local sketchbook | |
Desktop Templates log src | |
Documents Videos obj themes | |
Examples bin page-speed-images tmp | |
Firefox_wallpaper.png dev page-speed-javascript デスクトップ | |
Music hsptmp salasaga 編集中のドキュメント 1 | |
Pictures j602 server |
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 Foo | |
@baz = 1 | |
@@bar = 2 | |
def self.baz; @baz; end | |
def self.baz=(n); @baz=n; end | |
def self.bar; @@bar; end | |
def self.bar=(n); @@bar=n; end | |
end | |
class Hoge < Foo |
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
# 実現したいこと | |
puts "0" | |
# Golf | |
p 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
class Array | |
def nindex(n) | |
p self | |
_index = self.index(n) | |
if _index.nil? | |
return [] | |
else | |
if _index == (self.size - 1) | |
return [_index] | |
else |
OlderNewer