Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
1文字エイリアスのすゝめ
Search
Takafumi ONAKA
PRO
August 24, 2024
Technology
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
1文字エイリアスのすゝめ
2024-08-24 Kyoto.なんか #6
https://kyoto-nanka.connpass.com/event/324686/
Takafumi ONAKA
PRO
August 24, 2024
More Decks by Takafumi ONAKA
See All by Takafumi ONAKA
その Valkey 使いこなしていますか?
onk
PRO
5
2.3k
Hono x Inertia.js x Cloudflare_Workers
onk
PRO
0
20
気づけばこうなる運用 ~運用現場の現実と理想~
onk
PRO
0
100
プラットフォームを作る、プラットフォームを変える
onk
PRO
0
90
強いチームと開発生産性
onk
PRO
44
18k
ADRを運用して3年経った僕らの現在地
onk
PRO
22
26k
すこやかなサービス運営のための PWG (Performance Working Group)
onk
PRO
1
1.6k
オブザーバビリティの Primary Signals
onk
PRO
2
6.7k
Cache Stampede
onk
PRO
1
2.5k
Other Decks in Technology
See All in Technology
攻撃 3 時間 vs 復旧 10 時間。アクセスキー流出の非対称性を体感するために CTF を作った話
kazzpapa3
1
140
Strands Decider 2BでAWSアップデートの目利きをしてみた
sato4mi
1
100
複雑な業務システムを高速でつくるため、チーム全員をつくれる人へ
ayakurabuchi
0
130
The future of architectural work
ufried
0
150
生成AI時代のIAMのマニアックな話
takuros
3
320
AIエージェント統制はAPIから——押さえるべき5つの要素
nagix
0
120
Flutter Webを「SDK」として配る — 50以上のゲームを支える埋め込みアーキテクチャ
masayukisuda
0
180
レガシーコードに対する loop engineering的なAI開発プロセス導入について
kubell_hr
0
190
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
530
【dbts2026】AIエージェントの 判断と探索を変える、 データベース エンジニアリング― 既存DBの処理と依存関係から作る、オペレーショナルオントロジー ―
shisyu_gaku
0
100
reInvent2026stby LT00 "Change your life!"
shinichirokawano
1
570
FinOpsを導入してマルチプロダクトのコスト最適化を実現する
kworkdev
PRO
0
120
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
How to Talk to Developers About Accessibility
jct
2
610
A Soul's Torment
seathinner
8
3.9k
Agile that works and the tools we love
rasmusluckow
331
22k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Become a Pro
speakerdeck
PRO
31
6.3k
New Earth Scene 8
popppiees
4
2.8k
Skip the Path - Find Your Career Trail
mkilby
1
280
Everyday Curiosity
cassininazir
0
390
The Language of Interfaces
destraynor
162
27k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
300
Transcript
1文字エイリアスのすゝめ id:onk 2024-08-24 Kyoto.なんか 1
• 大仲 能史 a.k.a. id:onk • 芸歴20年目 • 株式会社はてな ◦
チーフエンジニア ◦ Mackerel 開発チーム 自己紹介 2
3 今日の話
4 1文字エイリアス 使っている人 ノシ
1文字エイリアス • alias s="git status -sb" • 13文字 -> 1文字
◦ 13倍の生産性!!! 5
1文字エイリアス • Q: 実際はEnterも押すから7倍では? ◦ Enterを押すだけで動くようにしてある(デモ • Enter で ls
と git status を表示すると便利 6
historyを集計する • zshにはhistory機能がある • head ~/.zsh_history 7
head ~/.zsh_history 8 : 1522742171:0;brew update : 1522742190:0;brew upgrade :
1522742201:0;brew search ghq : 1522742205:0;brew install ghq : 1522742215:0;ls -apl : 1522742221:0;byobu : 1522742271:0;byobu : 1522742277:0;exit : 1522742279:0;cd dotfiles : 1522742283:0;exit
head ~/.zsh_history 9 : 1522742171:0;brew update : 1522742190:0;brew upgrade :
1522742201:0;brew search ghq : 1522742205:0;brew install ghq : 1522742215:0;ls -apl : 1522742221:0;byobu : 1522742271:0;byobu : 1522742277:0;exit : 1522742279:0;cd dotfiles : 1522742283:0;exit Time.at 1522742171 => 2018-04-03 16:56:11 +0900
history 10 $ history | tail -n 3 624392 cd
memo 624393 s 624394 v
historyを集計する 11 $ history 1 | awk '{ print $2
}' | sort | uniq -c | sort -nr | head
historyを集計する 12 141945 g 136083 s 67635 v 41072 cd
28606 rg 26105 tig 16898 t 12128 plenv 9685 :q 7998 ll
ちなみに以下の略 • g=git • s=git status -sb • function v()
{vi -p ${${=*/:/ +}/:*}} • t=tig • :q=exit • ll=ls -lFG 13
ちなみに以下の略 14 • function v() {vi -p ${${=*/:/ +}/:*}} ◦
vi -p で全部タブで開く ▪ bufferよりタブ派 ◦ s/:/ +/ みたいなヤツ ▪ v README.md:100 で100行目を開きたい ▪ vim README.md +100 ▪ grep -n で出てくる形式に合わせて、コピペで該当行に飛べ るように
ちなみに以下の略 15 • :q=exit ◦ vim派なので使っていたが ◦ 最近は Ctrl+D で閉じるようになったので使ってない
• ll=ls -lFG ◦ -l はいつもの ◦ -F はディレクトリだとスラッシュが付くとか ◦
-G は色付け ◦ 今は l 1文字にエイリアスしている ちなみに以下の略 16
17 g=git
18 gitって サブコマンドあるよね
historyを集計する 19 $ history 1 | awk '{ print $2,$3
}' | grep "^g " | sort | uniq -c | sort -nr | head
historyを集計する 20 24054 g a 16190 g ci 12911 g
ds 12303 g co 9046 g f 6665 g ap 5904 g switch 5844 g fix 5311 g b 5180 g r
• g a=git add • 2万回も叩いているなら1文字エイリアスに昇 格すると良いのでは??? ◦ alias a="git
add" まだまだ最適化できる 21
• g ds=git diff --staged -b • 1万回も叩いているなら1文字エイリアスに昇 格すると良いのでは?? ◦
alias d="git diff --staged -b" ◦ もともとalias d=dockerだったけど、より回数が多い 方を優先したいので徴収 まだまだ最適化できる 22
• git switch -d remotes/origin/HEAD ◦ remotes/origin ▪ ローカルでmainブランチは不要なのでremotesを直接見る ◦
main/masterが面倒ですよね ▪ git symbolic-ref refs/remotes/origin/HEAD ▪ デフォルトブランチが取れる! • をmに割り当てている gitのオススメ 23
というわけでやっていくぞ • 俺たちの手癖はまだまだ最適化できる • 使用頻度に合わせて最適化するのがオススメ ◦ 単純に生産性が上がる ◦ 文字数が少ないのは正義 •
ハフマン符号化 24
想定質問 • 他人のPCで困らない? ◦ 手癖がオプションを覚えてないので多少は困る ◦ aliasを作るときにしっかりオプション調べるので、 存在は覚えている=1回help見たら分かるので大丈夫 25
想定質問 • fishのabbrの方が ◦ 履歴を取って、最適化ループを回したい ◦ abbrはhistoryに「どう入力したか」は残らない 26