文系 | 理系 | |
---|---|---|
体育系 | 害 | ゴミ |
文化系 | 無能 | 勝者 |
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 perl | |
use utf8; | |
use strict; | |
use warnings; | |
use lib lib => glob 'modules/*/lib'; | |
use constant MAX_WORKER => 2; | |
use constant MAX_REQUEST_PER_CHILD => 100; | |
use constant INTERVAL => $ENV{INTERVAL} || 5; | |
use constant NAMESPACE => 'MyApp::Worker'; |
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 "glint" | |
ENV['RACK_ENV'] = 'test' | |
server = Glint::Server.new do |port| | |
require "rack" | |
require "webrick" |
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 | |
class I2CDevice | |
# ioctl command | |
# Ref. https://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/include/linux/i2c.h | |
I2C_RETRIES = 0x0701 | |
I2C_TIMEOUT = 0x0702 | |
I2C_SLAVE = 0x0703 | |
I2C_SLAVE_FORCE = 0x0706 | |
I2C_TENBIT = 0x0704 |
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 | |
# coding: utf-8 | |
class I2CDevice | |
# ioctl command | |
# Ref. https://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/include/linux/i2c.h | |
I2C_RETRIES = 0x0701 | |
I2C_TIMEOUT = 0x0702 | |
I2C_SLAVE = 0x0703 | |
I2C_SLAVE_FORCE = 0x0706 |
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
#!ruby | |
p RUBY_VERSION | |
b = binding | |
eval("a = 1", b) | |
eval("p a", b) # => 1 | |
p a # undefined local variable or method `a' for main:Object (NameError) |
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
use v5.14; | |
use utf8; | |
sub foo { | |
say wantarray ? 'wantarray!!' : "scalar!!!"; | |
shift; | |
} | |
say "list context"; | |
say "||"; |
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
{ | |
my @a = qw(a b c); | |
my @b = qw(d e f); | |
my @foo = @a || @b; | |
use Data::Dumper; | |
warn Dumper @foo ; | |
#=> $VAR1 = 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
object Foo {} |
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
diff --git a/t/040_tterse/013_wrapper.t b/t/040_tterse/013_wrapper.t | |
old mode 100644 | |
new mode 100755 | |
index df6c8dc..1b54806 | |
--- a/t/040_tterse/013_wrapper.t | |
+++ b/t/040_tterse/013_wrapper.t | |
@@ -69,6 +69,20 @@ X | |
T | |
Hello, TTerse world! | |
X |