Skip to content

Instantly share code, notes, and snippets.

@yoppi
yoppi / oop_19.md
Last active August 29, 2022 13:39
オブジェクト指向入門 - 19章

19章 方法論について

19.1 ソフトウェアの方法論: なぜとなに

人は導いてくれるものを欲する。成功するためにはそれにしたがっていさえ入れば良いというような、「真実の法則」の探求は、ソフトウェアにおいて新しいものでもないし、また、ソフトウェアに限定されるものでもない。
  • ソフトウェアの方法論から得られるものは何か、その方法論の限界はなにかを知っておくことが重要
  • 良いソフトウェアを作り出す絶対確実な方法というものはない
@yoppi
yoppi / caching_bundle_install.md
Last active December 16, 2021 02:10
GitHub Actions上でのbundle installのキャッシュ

モチベーション

毎回bundle installするのはコストがかかるため、Gemfileに変更がない場合はキャッシュしたい。

参考 https://blog.freks.jp/github-action-cache/

+      - name: cache bundle directory
+        uses: actions/cache@v1
+ with:
@yoppi
yoppi / recursive.vim
Created June 1, 2011 01:23
Recursive Function with Vim Script
function! Tree(lst, ret)
if empty(a:lst)
return a:ret
endif
let _ = a:ret + get(a:lst, 0)
return Tree(a:lst[1:-1], _)
endfunction
echo Tree(range(11), 0)
"=> 55
@yoppi
yoppi / readfile.go
Created August 18, 2018 05:18
Fileを読み込むやつ
$ ./file_read [~/d/src/go]
ReadFile:148545 elapsed:167.706µs
ReadLine:144946 elapsed:209.144µs
Scanner:144946 elapsed:553.246µs
@yoppi
yoppi / map.go
Created April 4, 2018 06:03
Goのmapは値渡しではない
$ ./map
map[1:hoge]
&map[1:hoge]
map[1:hogehoge]
&map[1:hogehoge]
@yoppi
yoppi / regexp.go
Last active October 20, 2017 09:37
キャプチャするしない
package regexp
import (
"regexp"
"testing"
)
func BenchmarkRegexp1(b *testing.B) {
re := regexp.MustCompile(`(iTunes)/(\d+)\.(\d+)`)
for i := 0; i < b.N; i++ {
@yoppi
yoppi / tcpdos.go
Last active May 12, 2017 04:17
DoS for TCP
package main
import (
"bytes"
"flag"
"fmt"
"net"
"runtime"
"strconv"
"sync"
@yoppi
yoppi / reading_dep.md
Last active April 5, 2017 04:17
depのコードリーディング

depのコードを読んで面白いとか思った所

genericsないから案件

https://github.com/golang/dep/blob/4105d3a/context.go#L200-208 こういった任意の型のコンテナの探索はGenericsだ!と息巻く人もいると思うけど、stringしか扱わないならベタで書いたほうが僕は読みやすくていいと思う。

@yoppi
yoppi / git_fileters.md
Last active March 27, 2017 05:20
gitのfilterで指定できるatom一覧
@yoppi
yoppi / uuid.sh
Created March 15, 2017 07:49
Gen uuid in command line
uuidgen | tr '[:upper:]' '[:lower:]' # Mac OS(darwin) generate default uppercase