Skip to content

Instantly share code, notes, and snippets.

View shyouhei's full-sized avatar

卜部昌平 shyouhei

View GitHub Profile

本年もRubyConfに行っていただきたく思います。

趣意

まあ前回と同じなのですけれども、それだけだとアレなので、繰り返させていただきますが、基本となるのはやはりRubyConfというカンファレンスがとてもよいカンファレンスだということです。RubyConfは「驚くほど同じだし、驚くほど違います」。同じ部分に関して言えば、RubyConfは海外のカンファレンスがどうとか以前の問題として、Rubyのカンファレンスなのです。ようするにおまえらは多少住む大陸が違った程度ではやっぱりおまえらということです。しかし違うところは違う。その違いを、ここで言葉で説明するのはたやすいが、私としてはぜひ皆さん自身の体験としてそれを得てほしいと思っているのです。なぜなら、体験することではじめて得られる部分があるからです。発表スライドや発表動画なら、こんにちインターネット経由でいくらでも入手可能です。それらは、無論、とても良いものですが、かといってそれだけではカンファレンスとして成立しないのも、お分かりかと思います。ぜひ、本物のRubyConfを体験してほしいし、RubyConfにはそれだけの価値はある、と信じています。

お金のこと

今年も卜部が全額負担する予定です。

zsh % rbenv install 2.0.0-dev
/home/shyouhei/.rbenv/plugins/ruby-build/bin/rbenv-install: line 66: rbenv-hooks: command not found
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /home/shyouhei/.rbenv/versions/2.0.0-dev
Cloning https://github.com/ruby/ruby.git...
Installing ruby-2.0.0-dev...
BUILD FAILED
# -*- coding: utf-8 -*- # Unicode UTF-8エンコーディングを指定する
# マルチバイトの乗算記号を含む文字列リテラル
s = "2×2=4"
# 文字列には5文字をエンコードする6バイトが含まれている
s.bytesize # => 6
s.bytesize.times {|i| print s.getbyte(i), " "} # "50 195 151 50 61 52"と表示
s.length # => 5
s.length.times {|i| print s[i], " "} # "2 × 2 = 4"と表示
@shyouhei
shyouhei / result
Last active December 16, 2015 21:29
これだからPerlは…
zsh % carton exec perl tmp.pl
$VAR1 = {
'1.79769313486232e+308' => '1.79769313486232e+308'
};
$VAR2 = {
'1.79769313486232e+308' => 'inf'
};
zsh % bundle exec ruby tmp.rb
{1.7976931348623157e+308=>1.7976931348623157e+308}
{"1.7976931348623157e+308"=>1.7976931348623157e+308}
#! /your/favourite/path/to/ruby
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Urabe, Shyouhei
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
zsh % bzip2 -d ruby-2.0.0-p195.tar.bz2 [2013/Aug/06(Tue) 20:55:30 JST][shyouhei][X121e][pts/7][screen 0]
bzip2: Data integrity error when decompressing.
Input file = ruby-2.0.0-p195.tar.bz2, output file = ruby-2.0.0-p195.tar
It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.
You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.
[
["ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p383.tar.gz", "4f49544d4a4d0d34e9d86c41e853db2e"]
["ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p420.tar.gz", "ca1eee44f842e93b5098bc5a2bb9a40b"]
["ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p249.tar.gz", "d7db7763cffad279952eb7e9bbfc221c"]
["ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p302.tar.gz", "f446550dfde0d8162a6ed8d5a38b3ac2"]
["ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p334.tar.gz", "aacb6ee5dfe2367682bba56af7f415b8"]
["ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p352.tar.gz", "0c33f663a10a540ea65677bb755e57a7"]
["ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p357.tar.gz", "b2b8248ff5097cfd629f5b9768d1df82"]
["ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p358.tar.gz", "26bd55358847459a7752acdbd33a535f"]
["ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p370.tar.gz", "98b00bbd1cdde3116155edb6e555b781"]
@shyouhei
shyouhei / git-strata.rb
Last active December 8, 2019 07:35
This is git-strata, an extended version of git-blame. It takes a path and generates git-blame like output. The difference is, it also shows you how much edits the line experienced.
#! /your/favourite/path/to/ruby
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Urabe, Shyouhei
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@shyouhei
shyouhei / gist:7507489
Last active December 28, 2015 13:28
sample output of git-strata
c36ee7b -> 4259d23 (shyouhei 2012-08-21 08:10:37 +0000) # Copyright (C) 2011 Urabe, Shyouhei. All rights reserved.
c36ee7b -> 4259d23 (shyouhei 2012-08-21 08:10:37 +0000) #
c36ee7b -> 4259d23 (shyouhei 2012-08-21 08:10:37 +0000) # This file is a part of the programming language Ruby. Permission is hereby
c36ee7b -> 4259d23 (shyouhei 2012-08-21 08:10:37 +0000) # granted, to either redistribute or modify this file, provided that the
c36ee7b -> 4259d23 (shyouhei 2012-08-21 08:10:37 +0000) # conditions mentioned in the file COPYING are met. Consult the file for
c36ee7b -> 4259d23 (shyouhei 2012-08-21 08:10:
@shyouhei
shyouhei / gist:7768669
Created December 3, 2013 12:53
ごらんのありさまだよ
zsh % cat /etc/lsb-release; /usr/bin/ruby -rsvn/client -ve0
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.10
DISTRIB_CODENAME=saucy
DISTRIB_DESCRIPTION="Ubuntu 13.10"
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
/usr/lib/ruby/vendor_ruby/svn/client.rb:643: warning: assigned but unused variable - item_wrapper
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- svn/ext/core (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/vendor_ruby/svn/error.rb:21:in `<top (required)>'