This file contains hidden or 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 DATA.read #=> prints "hi\n" | |
__END__ | |
hi |
This file contains hidden or 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
if [ "$SHLVL" == "1" ]; then | |
exec zsh | |
fi |
This file contains hidden or 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
type Op = Fn(u16, u16); | |
fn op_mov(one: u16, two: u16) { | |
} | |
fn op_add(one: u16, two: u16) { | |
} | |
fn op_nand(one: u16, two: u16) { | |
} |
This file contains hidden or 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
type Op = Fn(u16, u16); | |
fn op_mov(one: u16, two: u16) { | |
} | |
fn op_add(one: u16, two: u16) { | |
} | |
fn op_nand(one: u16, two: u16) { | |
} |
This file contains hidden or 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
let mut methods = std::collections::HashMap::new(); | |
methods.insert(0b0000, mov); | |
methods.insert(0b0001, add); | |
methods.insert(0b0010, nand); | |
// ... | |
fn execute(opcode: u8, operand1: u8, operand2: u8) { | |
methods.get(opcode)(operand1, operand2) | |
} |
This file contains hidden or 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 = { | |
0b0000 => :mov, | |
0b0001 => :add, | |
0b0010 => :nand, | |
# ... | |
} | |
def execute(opcode, operand1, operand2) | |
send(methods[opcode], operand1, operand2) | |
end |
This file contains hidden or 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
C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:675:in `method_missing': undefined method `its' for RSpec::ExampleGroups::GithubConfiguration:Class (NoMethodError) | |
from C:/Users/Marie/dev/ruby/piotrmurach/github/spec/github/configuration_spec.rb:11:in `block in <top (required)>' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:385:in `module_exec' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:385:in `subclass' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:255:in `block in define_example_group_method' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/dsl.rb:43:in `block in expose_example_group_alias' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/dsl.rb:82:in `block (2 levels) in expose_example_group_alias_globally' | |
from C:/Users/Marie/dev/ruby/piotr |
This file contains hidden or 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
C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:675:in `method_missing': undefined method `its' for RSpec::ExampleGroups::GithubConfiguration:Class (NoMethodError) | |
from C:/Users/Marie/dev/ruby/piotrmurach/github/spec/github/configuration_spec.rb:11:in `block in <top (required)>' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:385:in `module_exec' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:385:in `subclass' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:255:in `block in define_example_group_method' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/dsl.rb:43:in `block in expose_example_group_alias' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/dsl.rb:82:in `block (2 levels) in expose_example_group_alias_globally' | |
from C:/Users/Marie/dev/ruby/piotr |
This file contains hidden or 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
C:/Users/Marie/dev/ruby/piotrmurach/github/spec/spec_helper.rb:34:in `block in <top (required)>': undefined method `color_enabed=' for #<RSpec::Core::Configuration:0x00000002ea5ec8> (NoMethodError) | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core.rb:97:in `configure' | |
from C:/Users/Marie/dev/ruby/piotrmurach/github/spec/spec_helper.rb:31:in `<top (required)>' | |
from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require' | |
from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require' | |
from C:/Users/Marie/dev/ruby/piotrmurach/github/spec/github/api/arguments/parse_spec.rb:3:in `<top (required)>' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `load' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_fles' | |
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3. |
This file contains hidden or 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 'spinny/utilities' | |
=begin | |
def foo | |
def foo | |
1 | |
end |