This is not intended to be comprehensive or authoritative, just free online resources I've found valuable while learning more about Erlang.
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
methods = Hash.new do |hash, klass| | |
klass.instance_methods.each do |mid| | |
m = klass.instance_method mid rescue next | |
hash[m.name] = [] unless hash.key? m.name | |
hash[m.name] |= [klass] | |
end | |
end | |
ObjectSpace.each_object(Class) do |klass| | |
methods[klass] |
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 Thread | |
alias fiber_variable_get [] | |
alias fiber_variable_set []= | |
alias [] thread_variable_get | |
alias []= thread_variable_set | |
end | |
class Fiber | |
def [] key | |
Thread.current.fiber_variable_get key |
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
RubyVM::FrozenCore = (-1024..1024) | |
.map { |offset| RubyVM.object_id + offset } | |
.map { |ptr| ObjectSpace._id2ref(ptr) rescue nil } | |
.grep(Class) | |
.find { |k| k.method_defined?(:"core#define_method") } | |
class RubyVM::FrozenCore | |
set_postexe = instance_method(:"core#set_postexe") | |
define_method(:"core#set_postexe") { |*| self } |
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 PipeMixin | |
def >>(proc_or_method, *) | |
case proc_or_method | |
when Proc, Method, UnboundMethod | |
proc_or_method.call(self) | |
else | |
super | |
end | |
end | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> | |
<script src="http://builds.emberjs.com.s3.amazonaws.com/handlebars-1.0.0-rc.4.js"></script> | |
<script src="http://builds.emberjs.com.s3.amazonaws.com/ember-1.0.0-rc.6.js"></script> | |
<meta charset=utf-8 /> | |
<title></title> | |
</head> | |
<body> |
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 | |
define_method(:bar, &RubyVM::InstructionSequence.new('self').method(:eval)) | |
end | |
Foo.new.bar | |
#=> main |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> | |
<script src="http://builds.emberjs.com.s3.amazonaws.com/handlebars-1.0.0-rc.4.js"></script> | |
<script src="http://builds.emberjs.com.s3.amazonaws.com/ember-1.0.0-rc.6.js"></script> | |
<meta charset=utf-8 /> | |
<title></title> | |
</head> | |
<body> |
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 UnboundMethod | |
def self.new(name = :'', &block) | |
Module.new.module_eval do | |
define_method(name, block) | |
instance_method(name) | |
end | |
end | |
def call(receiver, *args, &block) | |
bind(receiver).call(*args, &block) |
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
source 'https://rubygems.org' | |
gem 'minitest', '~> 5.0' |