Skip to content

Instantly share code, notes, and snippets.

View shyouhei's full-sized avatar

卜部昌平 shyouhei

View GitHub Profile
@shyouhei
shyouhei / gist:0b7dab3e75bfbf96f895
Created March 31, 2015 15:26
新社会人の人が留意すべき事項

新社会人に必須である:

  • 勤務先との書面による「労働契約」。業務委託契約等NG。
  • 多寡を問わず毎月払われる給料。遅配等論外である。
  • 健康保険。
  • 労災保険。
  • 雇用保険。
  • 三六協定。
  • 年次有休。
  • 育児休業の制度があり取得者がいる会社に勤務する。
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 / 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
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 / 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:

@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)>'
@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 / 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:
[
["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"]
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.