#dev notes

Vim mini cheatsheet

// dev notes

Vim mini cheatsheet Insert modes: A to insert at end of line a to insert after next char i to insert at current cursor Visual modes: v character, V: line ↑ ↓ ← → to select text d to cut, y to copy (yank) Move cursor to position and P to paste before or p to paste after Normal mode: y{motion} for copying and cutting in normal mode Y: yanks current line, including newline char at the end yiw: yanks current word without surrounding whitespace yaw: yanks current word with surrounding whitespace Cutting can be done with d{motion} Deleting lines dd to delete current line :10d to delete Line 10 :10,20d to delete from Line 10 to Line 20 10gg or :10 + Enter to go to Line 10 x delete character after cursor, X for before u to undo .

PostgreSQL

// dev notes

DB scripts the hard (dumb?) way Since I’m completely new to this, I’m learning by writing DB scripts from scratch. The three basic scripts I have when bootstrapping apps: reset.sh, schema.sh and seed.sh # reset.sh printf '===Reset DB===\n' psql -U DB_USERNAME -d DB_NAME << EOF DROP TABLE IF EXISTS table_1 table_2; EOF printf '===DB Reset===\n' # schema.sh psql -U DB_USERNAME -d DB_NAME << EOF CREATE TABLE users ( user_id serial PRIMARY KEY, user_first_name text DEFAULT '', user_last_name text DEFAULT '', user_username text UNIQUE DEFAULT '', user_photo_url text DEFAULT '', user_auth_date text DEFAULT '', session_id text DEFAULT '' ); EOF printf '===Loading Schema===\n' # seed.

Learn CS

// dev notes

My course assignments are documented in my github repo. CS106B Truth and beauty. Working software is not enough; well-designed and well-engineered code matters. Everything in Java lives inside a class, whereas there are functions in C/C++ that don’t and hence allow you to do stuff in a more procedural way. Function prototypes are a way of telling the compiler about something that’s coming up later. <<: string insertion operator. Integer division has truncation built into it.

Getting warm with Machine Learning

// dev notes

My current role as a Design Technologist is centred around building prototypes to describe ideas, stimulate conversations, and even provoke wilder imaginations. Designing for the future can sometimes mean building things that are not solving an immediate problem or pain point. Anyhow, I’ve been diving into ML for quite some time, and am taking notes along the way as I grow from “copy, paste & pray” to understanding what’s really going on.

Hugo, Gitlab Pages & Cloudflare

// dev notes

Some tips & gotchas I collected while migrating from Jekyll to Hugo + Gitlab Pages + Cloudflare: Gitlab Pages doesn’t allow users to remove the default gitlab.io URL even if you’ve added your custom domains. Make sure you have a canonical reference in every page. hugo server --baseURL http://192.168.1.2 --bind 192.168.1.2 if you want to make your local testing available on local wifi network. It’s a good practice to end baseURL in your config.

Setting up a new environment

// dev notes

Customising terminal vim config set number :highlight LineNr ctermfg=DarkGrey hi MatchParen cterm=bold ctermbg=none ctermfg=magenta iTerm 2 grml zsh spaceship-prompt zsh-autosuggestions dircolors zsh-syntax-highlighting useful aliases export ..='cd ../' export serve='python3 -m http.server 8000'. Also, check out this awesome gist. separate functions into different file and source it # .zshrc.local if [ -f ~/.zshrc.functions ]; then source ~/.zshrc.functions else print "404: ~/.