Skip to content

Instantly share code, notes, and snippets.

View shyouhei's full-sized avatar

卜部昌平 shyouhei

View GitHub Profile
@shyouhei
shyouhei / gist:7905704
Last active December 31, 2015 00:09
"svn→git gateway reconstruction" super personal note

Note from the author : After 3 years, I translate this into English. I have to emphasize this is a "svn git gateway", not svn←git. I have never tried opposite way, and can hardly believe that works without modifications. At your own risk please.


"svn→git gateway reconstruction" super personal note

Too fussy to generalize… Smells like groovy to others though…

Lines:

zsh % PERL_CARTON_MIRROR=https://denapan.dena.jp carton install
Installing modules using cpanfile
You have SQL::Abstract (1.74)
You have Module::Functions (2.1.3)
You have DBD::mysql (4.024)
You have Digest::MD5 (2.52)
You have Test::Deep::Matcher (0.01)
Successfully installed DBIx-DBHResolver-Strategy-PaymentMapper-0.02
You have Furl (2.19)
You have Getopt::Long (2.39)
@shyouhei
shyouhei / raddrinfo.c
Last active August 29, 2015 13:56
git-strata
97cbab7 (akr 2009-01-17 04:11:27 +0000) /************************************************
97cbab7 (akr 2009-01-17 04:11:27 +0000)
97cbab7 (akr 2009-01-17 04:11:27 +0000) ainfo.c -
97cbab7 (akr 2009-01-17 04:11:27 +0000)
97cbab7 (akr 2009-01-17 04:11:27 +0000) created at: Thu Mar 31 12:21:29 JST 1994
97cbab7 (akr 2009-01-17 04:11:27 +0000)
97cbab7 (akr 2009-01-17 04:11:27 +0000) Copyright (C) 1993-2007 Yukihiro Matsumoto
97cbab7 (akr 2009-01-17 04:11:27 +0000)
97cbab7 (akr
irb(main):022:0> [1, 10, 100, 1000, 100000, 1000000, 10000000].each {|i| p(fib(i) % 1000000) }
1
55
915075
228875
746875
546875
546875
=> [1, 10, 100, 1000, 100000, 1000000, 10000000]
irb(main):023:0> (3 ** 546875) % 1000000
@shyouhei
shyouhei / gist:0b7dab3e75bfbf96f895
Created March 31, 2015 15:26
新社会人の人が留意すべき事項

新社会人に必須である:

  • 勤務先との書面による「労働契約」。業務委託契約等NG。
  • 多寡を問わず毎月払われる給料。遅配等論外である。
  • 健康保険。
  • 労災保険。
  • 雇用保険。
  • 三六協定。
  • 年次有休。
  • 育児休業の制度があり取得者がいる会社に勤務する。
def Archimedean_spiral n
if n == 0
return [ [ '#' ] ]
else
inner = Archimedean_spiral(n - 1)
length = inner.size
ret = []
ret << ([ '#', '#' ] + ([ '#' ] * length) + [ '#', '#' ] )
ret << ([ '#', ' ' ] + ([ ' ' ] * length) + [ ' ', ' ' ] )
inner.each do |x|
n = ARGV.first.to_i
size = n * 4 + 1
spiral = Array.new(size) { Array.new(size) { ' ' } }
def Archimedean_spiral_sequence(n)
if n == 0
yield 0, 0
else
Archimedean_spiral_sequence(n - 1) do |x, y|
yield x + 2, y + 2
  • original: まあRubyの場合ナイスナイスいうわりに女性は増えないし人種も増えないし、なにかの参入障壁はあるんだとおもうよ。そういうのを改善していくこと自体は否定すべきではないよ。各論がいろいろあるのはわかるけど大まかな方向性としてはもっと開かれていくべきというのは正しいと思う。
  • translated: "Well, when it comes to Ruby, they say ``nice'' frequently but the fact is that women are not increasing; also not racial diversity. I guess there are something that prevent variety. I think we should not deny improving this situation. I know there are debates in particular areas but in general, it should become more open."

(translation note: the "Ruby" here points to Ruby's core development, not e.g. Rails.)

diff --git a/ChangeLog b/ChangeLog
index d3b2eee..3dece77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8166,8 +8166,8 @@ For the changes before 1.8.0, see doc/ChangeLog-1.8.0
Local variables:
coding: us-ascii
-add-log-time-format: (lambda ()
- (let* ((time (current-time))
@shyouhei
shyouhei / -
Created November 16, 2016 10:38
num calls time self name
-----------------------------------------------------------------------------------
1) 9 1845.61 205.07 73.57% 1827.60 203.07 72.85% (anon)
2) 6 196.11 32.69 7.82% 188.84 31.47 7.53% __zplug::core::core::get_interfaces
3) 2 141.01 70.50 5.62% 112.24 56.12 4.47% compinit
4) 1 485.69 485.69 19.36% 72.32 72.32 2.88% __zplug::io::cache::load
5) 2 50.65 25.32 2.02% 50.44 25.22 2.01% __zplug::base::base::git_version
6) 1 44.42 44.42 1.77% 44.30 44.30 1.77% _zsh_highlight_load_highlighters
7) 2 34.01 17.00 1.36% 34.01 17.00 1.36% __zplug::utils::awk::available
8) 2 28.76 14.38 1.15% 28.76 14.38 1.15% compaudit