DEV Community

Tom Harada
Tom Harada

Posted on • Edited on

Hardware, Software, Learning Sources

Hardware

Keyboard

Monitor

Computer

  • MBP (max the specs if you use it a lot, esp. for mobile or client development, you use it a lot - MB4 / 128GB / 8TB) + Cloud/EC2 desktop

Headphones

  • Apple Wired Headphones (I just lost too many AirPods Pro in the laundry and these work fine, good microphone, able to switch between phone and laptop, etc).

Desktop Software

macOS

  • defaults
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
Enter fullscreen mode Exit fullscreen mode
  • System Preferences
    • Keyboard
    • map Caps Lock -> Control
    • set key repeat to fastest and delay shortest

Chrome

  • ARIA Devtools
  • Tampermonkey

Programming Languages

Design software

  • Figma
  • Blender (shortcuts to not use numkey and track pad), Inkscape, Krita (simpler the better until you need extra features)
  • After Effects, Illustrator, Photoshop, Premiere Pro

Work productivity software

  • Communication: Slack, Chime, Outlook
  • Notes and todos: Things (also things-patcher)
  • Scripts: use expect scripts and the macOS Keychain app to automate VPN and access token initialization daily on laptop and cloud desktops.
  • LLMs: Claude (Anthropic) for work, GPT for personal
  • Coding CLIs: Q CLI for work, Claude Code for personal

Terminal (Warp)

  • .warp/keybindings.yaml
"editor_view:insert_autosuggestion": tab
"pane_group:navigate_left": cmd-left
"editor_view:home": none
"workspace:activate_prev_tab": alt-cmd-left
"editor_view:end": none
"workspace:activate_next_tab": alt-cmd-right
"input:open_completion_suggestions": ctrl-space
"pane_group:navigate_right": cmd-right
Enter fullscreen mode Exit fullscreen mode
inoremap fd <Esc>
vnoremap fd <Esc>
"set timeoutlen=200
nnoremap ; :
nnoremap : ;
vnoremap ; :
vnoremap : ;
set splitbelow
set splitright
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l

tnoremap <C-h> <C-\><C-n><C-w>h
tnoremap <C-j> <C-\><C-n><C-w>j
tnoremap <C-k> <C-\><C-n><C-w>k
tnoremap <C-l> <C-\><C-n><C-w>l

" Function to insert matching pairs and avoid adding a third character if there are already two
function! s:AutoClosePair(open, close)
    " Get the current line and column
    let l:col = col('.')
    let l:line = getline('.')

    " Define a range around the cursor to check for existing characters
    let l:range_start = max([l:col - 3, 0])
    let l:range_end = min([l:col + 2, strlen(l:line)])

    " Get the substring around the cursor
    let l:context = l:line[l:range_start:l:range_end]

    " If the context contains the closing character, do nothing
    if l:context =~ a:close
        return a:open
    else
        " Otherwise, insert the pair and move the cursor back
        return a:open . a:close . "\<Left>"
    endif
endfunction

" Map the insert mode keys to the function
inoremap <expr> " <SID>AutoClosePair('"', '"')
inoremap <expr> ' <SID>AutoClosePair("'", "'")
inoremap <expr> ( <SID>AutoClosePair('(', ')')
inoremap <expr> [ <SID>AutoClosePair('[', ']')
inoremap <expr> { <SID>AutoClosePair('{', '}')

" Basic settings
syntax on
filetype plugin indent on
set encoding=utf-8
"set number                " Show line numbers
"set relativenumber        " Relative line numbers (optional, remove if you don't like)
"set cursorline           " Highlight current line
"set showmatch            " Show matching brackets
set mouse=a              " Enable mouse support

" Python-specific indentation
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab            " Use spaces instead of tabs
set autoindent
set fileformat=unix

" Search improvements
set incsearch            " Search as you type
set hlsearch             " Highlight search results
set ignorecase           " Case-insensitive search
set smartcase            " Case-sensitive if uppercase used

" Quality of life
set backspace=indent,eol,start
set clipboard=unnamed    " Use system clipboard

" Remove trailing whitespace on save
autocmd BufWritePre *.py :%s/\s\+$//e


" Swap files
set swapfile
set directory=~/.vim/swap//

" Backup files
set backup
set backupdir=~/.vim/backup//

" Undo files (persistent undo history)
set undofile
set undodir=~/.vim/undo//

" Create these directories if they don't exist
silent !mkdir -p ~/.vim/swap ~/.vim/backup ~/.vim/undo

let mapleader = ","

" Insert pdb breakpoint
nnoremap <leader>b Oimport pdb; pdb.set_trace()<Esc>
" Insert print debug
""nnoremap <leader>p Oprint(f"DEBUG: {}")<Esc>F{a

" Quick save and run
nnoremap <leader>r :w<CR>:!python %<CR>

function! InsertAdvancedDebug()
    let current_line = line('.')
    let indent = indent('.')
    let spaces = repeat(' ', indent)

    " Find the current function
    let func_line = search('^\s*def \w\+', 'bnW')
    let context = ""

    if func_line > 0
        let func_text = getline(func_line)
        let func_name = matchstr(func_text, 'def \zs\w\+\ze(')

        " Check if we're also in a class
        let class_line = search('^\s*class \w\+', 'bnW')
        if class_line > 0 && class_line < func_line
            let class_text = getline(class_line)
            let class_name = matchstr(class_text, 'class \zs\w\+\ze')
            let context = class_name . '.' . func_name
        else
            let context = func_name
        endif

        " Get parameters
        let params_full = matchstr(func_text, 'def \w\+(\zs[^)]*\ze)')
        let params_clean = substitute(params_full, ':\s*[^,=]*', '', 'g')
        let params_clean = substitute(params_clean, '=\s*[^,]*', '', 'g')
        let params_clean = substitute(params_clean, '\s', '', 'g')

        let param_list = split(params_clean, ',')
        let param_list = filter(param_list, 'v:val != "self" && v:val != "cls" && v:val != ""')

        if len(param_list) > 0
            let param_debug = join(map(copy(param_list), 'v:val . "={" . v:val . "}"'), ", ")
            let debug_line = spaces . 'print(f"DEBUG ' . context . '():' . current_line . ' ' . param_debug . '")'
        else
            let debug_line = spaces . 'print(f"DEBUG ' . context . '():' . current_line . ' here")'
        endif
    else
        " Check if we're in a class but not in a method
        let class_line = search('^\s*class \w\+', 'bnW')
        if class_line > 0
            let class_text = getline(class_line)
            let class_name = matchstr(class_text, 'class \zs\w\+\ze')
            let debug_line = spaces . 'print(f"DEBUG ' . class_name . ':' . current_line . ' here")'
        else
            " Global scope
            let filename = expand('%:t:r')
            let debug_line = spaces . 'print(f"DEBUG ' . filename . ':' . current_line . ' here")'
        endif
    endif

    call append(line('.'), debug_line)
    normal! j
endfunction

nnoremap <leader>d :call InsertAdvancedDebug()<CR>
Enter fullscreen mode Exit fullscreen mode
  • .secure
export CDESK_HOST='<cloud host>'
alias c='ssh $CDESK_HOST'
alias sf-c='sftp $CDESK_HOST'
qc() {
 echo "please do a git diff --cached and then git commit changes with a good commit message summarizing the changes using conventional commit format; and please don’t add that  it was assisted by Amazon Q in the commit message" | q chat --no-interactive --trust-all-tools
}
alias q='q chat --trust-all-tools'
...
Enter fullscreen mode Exit fullscreen mode

Learning resources

General

Design

Web

Algorithms

Architecture

ML, AI

3D

Management

Misc

Top comments (0)