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
def myset(a1, a2) | |
h = Hash.new(0) | |
a1.each{|a| h[a] += 1} | |
a2.each{|a| h[a] += 1} | |
puts "a and b" | |
p h.select{|k, v| v == 2}.keys | |
puts "a or b" | |
p h.keys |
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
use AnyEvent; | |
use AnyEvent::HTTP; | |
my $w; | |
my $cv = AE::cv; | |
my @urls = qw{ | |
http://localhost:5000/ | |
http://localhost:5001/ | |
}; | |
my @watchers; |
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
var DateTime = function() { | |
var now = new Date(); | |
this.year = now.getFullYear(); | |
this.month = ('00' + now.getMonth()).slice(-2); | |
var monthEndDate = new Date(this.year, this.month, 0); | |
this.startDate = this.year + '-' + this.month + '-01'; | |
this.endDate = this.year + '-' + this.month + '-' + monthEndDate.getDate(); | |
} | |
var Profile = function(profileName, tableId) { |
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
$ git submodule add git@github.com:kentaro/mruby-hibari.git deps/mruby-hibari | |
$ cmake -DWITH_MRUBY=ON . && make | |
$ ./h2o --version && ./h2o -c examples/h2o_mruby/h2o.conf | |
h2o version 1.5.0-beta2 | |
OpenSSL: OpenSSL 1.0.2d 9 Jul 2015 | |
mruby: YES | |
[INFO] raised RLIMIT_NOFILE to 10240 | |
fetch-ocsp-response (using OpenSSL 1.0.2d 9 Jul 2015) | |
fetch-ocsp-response (using OpenSSL 1.0.2d 9 Jul 2015) | |
h2o server (pid:60181) is ready to serve requests |
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
➜ h2o git:(master) sw_vers | |
ProductName: Mac OS X | |
ProductVersion: 10.9.5 | |
BuildVersion: 13F34 | |
➜ h2o git:(master) openssl version | |
OpenSSL 0.9.8za 5 Jun 2014 | |
➜ h2o git:(master) git checkout refs/tags/v1.2.0 -b v1.2.0 | |
Switched to a new branch 'v1.2.0' | |
➜ h2o git:(v1.2.0) vim examples/libh2o/simple.c | |
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
➜ h2o git:(v1.2.0) ✗ sw_vers -productVersion | |
10.9.5 | |
➜ h2o git:(v1.2.0) ✗ openssl version | |
OpenSSL 0.9.8za 5 Jun 2014 | |
➜ h2o git:(master) ✗ git checkout refs/tags/v1.2.0 -b v1.2.0 | |
Switched to a new branch 'v1.2.0' | |
➜ h2o git:(v1.2.0) ✗ git log | |
➜ h2o git:(v1.2.0) ✗ cmake -DWITH_BUNDLED_SSL=on . && make | |
-- checking for module 'libwslay' | |
-- package 'libwslay' not found |
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
➜ nghttp2 git:(master) nghttp --verbose https://localhost | |
[ 0.002] Connected | |
[ 0.004][NPN] server offers: | |
* h2 | |
* h2-16 | |
* h2-14 | |
The negotiated protocol: h2-16 | |
[ 0.007] send SETTINGS frame <length=12, flags=0x00, stream_id=0> | |
(niv=2) | |
[SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100] |
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
% h2spec -p 8080 -h `boot2docker ip` | |
The VM's Host only interface IP address is: | |
3.5. HTTP/2 Connection Preface | |
✓ Sends invalid connection preface | |
4.2. Frame Size | |
✓ Sends too small size frame | |
✓ Sends too large size frame |
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
% make | |
git submodule init | |
git submodule update | |
cd /tmp/src/trusterd/mruby && cp -f ../build_config.rb . && rake | |
GIT CHECKOUT master | |
Already on 'master' | |
Your branch is up-to-date with 'origin/master'. | |
GIT CHECKOUT master | |
Already on 'master' | |
Your branch is up-to-date with 'origin/master'. |
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
decode_tables_: { | |
prefix_length: 0, indexed_length: 9, entries_offset: 0 | |
} | |
decode_tables_.size(): 1 | |
decode_entries_: { | |
next_table_index: 0, length: 2, symbol_id: 2 | |
next_table_index: 0, length: 2, symbol_id: 2 | |
next_table_index: 0, length: 2, symbol_id: 2 |