Skip to content

Instantly share code, notes, and snippets.

@ktunprasert
ktunprasert / cheat.fish
Last active November 19, 2023 00:46
Collection of fish functions to make my life easier
# Cheat.sh function
function cheat --description ="Curl commands from cheat.sh with the format 'cheat.sh/[0]/[1]/...'"
# Arguments parsing
# from: > cheat go :learn
# to: go/:learn
set path (echo $argv | sed 's/\s/\//g')
echo $path
# curl (echo cheat.sh/$path) | bat
curl (echo cheat.sh/$path)
end
set tabstop=2 " number of columns occupied by a tab
set clipboard=unnamedplus " using system clipboard
" filetype plugin on
" set undodir=~/.vimdid
" set undofile
" set spell
" set noswapfile " disable creating swap file
" set backupdir=~/.cache/vim " Directory to store backup files.
"
nmap ; :
Mix.install([
{:explorer, "~> 0.7.0"},
{:jason, "~> 1.4"},
{:httpoison, "~> 2.1.0"}
])
files = [
"input/2023/august/csv/6602.csv"
# "input/2023/august/csv/6603.csv"
]
@ktunprasert
ktunprasert / keymapper.conf
Last active October 31, 2023 21:48
Keymapper configuration for programming layers and utility
[modifier="Tab"]
I >> ArrowUp
K >> ArrowDown
J >> ArrowLeft
L >> ArrowRight
Backquote >> F1
1 >> F2
2 >> F3
3 >> F4
@ktunprasert
ktunprasert / config.kdl
Last active October 28, 2023 16:04
Zellij config
keybinds clear-defaults=true {
normal {
// uncomment this and adjust key if using copy_on_select=false
// bind "Alt c" { Copy; }
bind "Alt w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
bind "Alt z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
}
locked {
bind "Ctrl g" { SwitchToMode "Normal"; }
}
@ktunprasert
ktunprasert / keybindings.json
Last active June 20, 2022 22:10
VSCode + Vim
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "alt+0",
"command": "extension.deploy.compareFiles"
},
{
"key": "ctrl+alt+p c",
"command": "-extension.deploy.compareFiles"
},
@ktunprasert
ktunprasert / clean_code.md
Created April 7, 2022 08:29 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@ktunprasert
ktunprasert / .bashrc
Created January 10, 2022 23:52
Common alias for Git and other dev tools
alias gaa='git add -A'
alias ga='git add'
alias gb='git branch'
alias gc='git checkout'
alias gcb='git checkout -b'
alias gcm='git commit -m'
alias gcp='git cherry-pick'
alias gm='git merge'
alias gmnf='git merge --no-ff'
alias gp='git pull'