Skip to content

Instantly share code, notes, and snippets.

View miyataka's full-sized avatar
🎈
humming🎵

Takayuki Miyahara miyataka

🎈
humming🎵
View GitHub Profile
@miyataka
miyataka / appliable_knowledge.md
Created August 8, 2023 16:16
適用可能な知識とは?

活用可能な知識とは?

  • 活用するためには
    • 発見可能である
    • 理解可能である
    • 適用可能である
    • 場所によらずにアクセス可能である
  • 発見可能であること,場所によらずアクセス可能であること,については管理方法の問題である
  • 理解可能であること,適用可能であることは,コンテンツの問題である
@miyataka
miyataka / terminal-output-example.txt
Last active August 3, 2023 12:04
`-v` flag of go (mod)get is not working
➜ tmp pwd
/Users/takayuki.miyahara/wspace/tmp
➜ tmp
➜ tmp
➜ tmp cat go.mod
module example.com/modfoo
go 1.20
require golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b // indirect
@miyataka
miyataka / .zshrc
Created July 13, 2023 06:43
open files of showed by `git status|diff` by vim
# open all modified files
function gsv() {
vim $(git status --porcelain | awk '{print $2}')
}
function gdv() {
vim $(git diff $1 --name-only)
}
@miyataka
miyataka / go_download.sh
Created April 23, 2023 15:44
install go latest version script
#!/bin/bash
VERSION="1.20.3"
CPU="amd64"
arch=$(uname -i)
if [[ $arch == x86_64* ]]; then
echo "X64 Architecture"
CPU="amd64"
@miyataka
miyataka / .gitconfig
Last active November 27, 2022 11:08
git history next / prev command
# cf. https://coderwall.com/p/ok-iyg/git-prev-next
# cf. https://www.yhoka.com/posts/git-next-prev/
[alias]
prev = checkout HEAD^1
next = "!sh -c 'if [ \"$1\" = \"\" ]; then if [ \"$TARGET_BRANCH\" = \"\" ]; then if [ \"$(git branch | grep master)\" = \"\" ]; then TARGET_BRANCH=main; else TARGET_BRANCH=master; fi; fi; else TARGET_BRANCH=$1; fi; git log --reverse --pretty=%H $TARGET_BRANCH | grep $(git rev-parse HEAD) -A 1 | tail -1 | xargs git checkout' -"
@miyataka
miyataka / README.md
Created November 10, 2022 09:16
open all modified files with vim
@miyataka
miyataka / git-branch-cleanup.sh
Created July 14, 2022 10:32
git branch cleanup script
# c.f. https://blog.foresta.me/posts/git_useful_command_collection/
function git-cleanup() {
git branch --merged | egrep -v "\*|master|develop|main" | xargs git branch -D
git remote prune origin
git branch --format "%(refname:short) %(upstream:track)" | grep "\[gone\]" | awk '{print $1}' | xargs -IXXX git branch -D XXX
}
@miyataka
miyataka / death_march.md
Created February 10, 2022 04:29 — forked from voluntas/death_march.md
デスマーチが起きる理由 - 3つの指標

デスマーチが起きる理由 - 3つの指標

著者: 青い鴉(ぶるくろ)さん @bluecrow2

これは結城浩さんの運用されていた YukiWiki に当時 Coffee 様 (青い鴉(ぶるくろ)さん)がかかれていた文章です。 ただ 2018 年 3 月 7 日に YukiWiki が運用停止したため消えてしまいました。その記事のバックアップです。

今は 404 ですが、もともとの記事の URL は http://www.hyuki.com/yukiwiki/wiki.cgi?%A5%C7%A5%B9%A5%DE%A1%BC%A5%C1%A4%AC%B5%AF%A4%AD%A4%EB%CD%FD%CD%B3 になります。

昔、自分がとても感銘を受けた文章なので、このまま読めなくなるのはとてももったいないと思い、バックアップとして公開しています。

@miyataka
miyataka / .zshrc-sample
Created July 18, 2021 03:07
open github (current directory) repo page
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
alias og="open-github"
function open-github() {
url_string=$(git config --get remote.origin.url | cut -d':' -f2)
chrome https://github.com/${url_string: 0:-4}
}
@miyataka
miyataka / ip_ranges2prefix_list.rb
Created June 14, 2021 06:45
one liner: generate prefix list array from aws ip range json
# https://docs.aws.amazon.com/ja_jp/general/latest/gr/aws-ip-ranges.html#aws-ip-egress-control
# requirements
# - curl
# - jq
require 'json'
require 'yaml'
REGION='ap-northeast-1'