View zerolog_json_indent_writer.go
This file contains 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
type JSONIndentWriter struct { | |
Out io.Writer | |
} | |
func (w *JSONIndentWriter) Write(p []byte) (int, error) { | |
buf := new(bytes.Buffer) | |
if err := json.Indent(buf, p, "", " "); err != nil { | |
return 0, err | |
} |
View _youtube-timestamp.js
This file contains 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
console.log( | |
require("fs") | |
.readFileSync("input.txt") | |
.toString("utf-8") | |
.split("\n") | |
.map((line) => line.match(/=([\d]+) (.+)/)) | |
.filter((v) => v) | |
.map(([_, timestamp, text]) => ({ timestamp: Number(timestamp), text })) | |
.map( | |
({ timestamp, text }) => |
View globalization.md
globalization
参考記事
- https://zenn.dev/ucwork/articles/aws_globalization
- 考え方
- Read local, write global
- Read local, write partitioned
- Read local, write local
- 考え方
View kanashiine.md
突然消えた YouTube 動画のサムネイルを Firefox のキャッシュからサルベージする
- Firefox で
about:cache
にアクセスする Storage disk location
に書かれているパスをコピーする (ここでは/Users/lambdasawa/Library/Caches/Firefox/Profiles/xxxx.default-release-xxxx/cache2
とします)cd /Users/lambdasawa/Library/Caches/Firefox/Profiles/xxxx.default-release-xxxx/cache2
cd entries
mkdir -p ~/Downloads/thumbnail/ && for p in $(file * | grep RIFF | awk '{print $1}' | sed -E 's/://' ); do cp $p ~/Downloads/thumbnail/; done
open ~/Downloads/thumbnail/
- あとは目 grep で頑張ろう!
View go-snippet.md
go snippet
トータルのカバレッジ取得
go test ./... -cover -coverpkg=./... | grep -v 'no test files' | sed -E 's/.*coverage: (.+)%.*/\\1/' | paste -s -d+ - | bc
依存関係の有効グラフ描画
View README.md
GraphQL で作成した
amplify to terraform (WIP)
@model
を Terraform に移行する
GraphQL で作成した - amplify の中身は CloudFormation
@model
を削除するとテーブルが消える- amplify の管理からは外したいが、テーブル自体は残って欲しい
- 一般に CloudFormation で管理している AWS リソースを CloudFormation の管理外に置くには以下の手順が必要になる
- DeletionPolicy を Retain にする
- スタックからそのリソースを削除する (またはスタックごと削除)
NewerOlder