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
| #! /bin/bash | |
| npm run $(cat package.json | jq '.scripts | keys[]' | fzf | sed 's/"//g') |
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
| #! /bin/bash | |
| git checkout $(git branch -a | fzf | sed 's/.* //') |
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
| git log --grep "${1}" --no-merges --oneline | cut -d ' ' -f1 | xargs git revert --no-edit |
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
| #! /bin/bash | |
| git checkout $(git branch | grep $1 | head -n1) |
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
| # control character a instead of b | |
| unbind C-b | |
| set-option -g prefix C-a | |
| bind-key C-a send-prefix | |
| # set window name to current dir | |
| set-option -g status-interval 5 | |
| set-option -g automatic-rename on | |
| set-option -g automatic-rename-format '#{b:pane_current_path}' |
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
| alias ll="ls -laG" | |
| alias l="ls -G" | |
| alias g=git | |
| alias d=docker | |
| # stop ^ being interpreted by zsh | |
| setopt NO_NOMATCH | |
| # format user on prompt | |
| # source: https://stackoverflow.com/questions/689765/how-can-i-change-the-color-of-my-prompt-in-zsh-different-from-normal-text |
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
| [alias] | |
| l = log | |
| s = status | |
| c = commit | |
| a = add | |
| d = diff | |
| dc = "diff --cached" | |
| chb = "checkout -b" |
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
| #!/usr/bin/env node | |
| /** | |
| * remove more than one consecutive space | |
| */ | |
| const readable = process.stdin; | |
| readable.on('readable', () => { | |
| let chunk; | |
| let prevCharSpace = false; |
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
| /** | |
| * remove tabs / newlines | |
| */ | |
| const readable = process.stdin; | |
| readable.on('readable', () => { | |
| let chunk; | |
| while (null !== (chunk = readable.read())) { | |
| for (const char of `${chunk}`) { | |
| if (char === '\t' || char === '\n') { |
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
| /** | |
| * indent string by parenthesis. | |
| */ | |
| const readable = process.stdin; | |
| let depth = 0; | |
| readable.on('readable', () => { | |
| let chunk; | |
| while (null !== (chunk = readable.read())) { | |
| for (const char of `${chunk}`) { |
NewerOlder