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
autoload 'B', './b.rb' | |
class Base | |
def self.nop(c); end | |
end | |
class A | |
class InnerA < Base | |
nop B::InnerA | |
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
irb(main):001:0> module I | |
irb(main):002:1> include | |
irb(main):003:1> end | |
=> I | |
irb(main):004:0> module P | |
irb(main):005:1> prepend | |
irb(main):006:1> end | |
=> P | |
irb(main):007:0> module E | |
irb(main):008:1> extend |
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
#define SIGNAL_5PIN 2 | |
#define SIGNAL_6PIN 1 | |
#define POWER_PIN 3 | |
#define MOTOR_POWER 255 | |
#define MOVE_TIME 20000 | |
#define STOP_TIME 1000 | |
void setup() { | |
pinMode(SIGNAL_5PIN, OUTPUT); | |
pinMode(SIGNAL_6PIN, OUTPUT); |
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
└> cargo outdate | |
error: no such subcommand | |
Did you mean `update`? |
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
require 'benchmark' | |
module Foo | |
def foo;end | |
end | |
times = 1_000_000 | |
Benchmark.bm 30 do |r| | |
r.report 'none' do |
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
require 'benchmark' | |
module Foo | |
end | |
times = 1_000_000 | |
Benchmark.bm 30 do |r| | |
r.report 'extend' do | |
times.times do |
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
module Foo | |
def foo | |
super | |
p :foo | |
end | |
end | |
module Fuga | |
def foo | |
super |
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
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' |
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
require 'timeout' | |
pid = Process.spawn('sleep', '10') | |
puts Time.now | |
begin | |
Timeout.timeout(1) { | |
Process.waitpid(pid) | |
} | |
rescue => e | |
p e |
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
source "https://rubygems.org" | |
gem 'rspec' |