- 社内用のリポジトリ管理のためにGitLabを使用
- pixivはPC・Touch版などがありそれぞれソースコードを一部共有しているためpixiv.gitという1つの大きなリポジトリで管理している
- 社内で一番大きく関わっている人も多いリポジトリ
- pixiv.gitは1.4GBくらい(昔は2GB超だったが工夫して減らした)なので外部サービスのGitHubに置くと遅すぎて開発ができない
- GitHubの障害によりデプロイができなくなるのも困る
- GitHubにはファイルの容量制限など様々な制限もあるのでそういったことで悩みたくない
- 社内のデータセンター内で管理する必要がある
- pixivはPC・Touch版などがありそれぞれソースコードを一部共有しているためpixiv.gitという1つの大きなリポジトリで管理している
- GitHub Enterpriseを使えば社内のサーバー上にGitHubを立てることができる
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
| package main | |
| import ( | |
| "bufio" | |
| "crypto/md5" | |
| "fmt" | |
| "os" | |
| "time" | |
| goCache "github.com/pmylund/go-cache" |
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
| package main | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "time" | |
| ) | |
| type weight struct { | |
| weight float64 |
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
| N = 2**60 | |
| r = 1.0 | |
| (1..7000000).each do |i| | |
| r *= ((N.to_f - i + 1) / N) | |
| end | |
| p 1 - r |
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 strict; | |
| use warnings; | |
| for (<>) { | |
| if (/\ACREATE TABLE ([`a-zA-Z0-9_]+)/) { | |
| print "\nALTER TABLE " . $1 . "\n"; | |
| } elsif (/\A[ ]+([`a-zA-Z0-9_]+) (varchar\(\d+\)|mediumtext|text)(( NOT NULL,)?)/) { | |
| if ($3) { | |
| print " MODIFY " . $1 . " " . $2 . " CHARACTER SET utf8mb4 NOT NULL,\n"; | |
| } else { |
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
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "time" | |
| ) | |
| var quitLock sync.RWMutex |
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
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "regexp" | |
| ) | |
| var digitRegexp = regexp.MustCompile("[0-9]+") |
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
| package main | |
| import ( | |
| "sync" | |
| "time" | |
| ) | |
| type clothes struct { | |
| Price int | |
| Folded bool |
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
| []*Entry{ | |
| &Entry{ | |
| Author: "catatsuy", | |
| Title: "ポエム", | |
| Basename: "poem", | |
| Status: "Publish", | |
| AllowComments: 1, | |
| AllowPings: 1, | |
| ConvertBreaks: "0", | |
| Date: time.Date(2017, time.April, 22, 20, 41, 58, 0, time.UTC), |
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
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| "os" | |
| ) | |
| func main() { | |
| host := os.Args[1] |