Short snippets about things I have learned. You can also browse by tag!
Posts
- Human readable from Unix timestamp
- Hello-world
- String line count in Postgres
- grep -v prints non-matching lines
- Listing large files
- Remove all changes to a file with git restore
- Stash Git changes, but keep staged changes
- Delete last local commits
- Combine PDFs with Ghostscript
- My Git aliases
- Restoring a deleted file using Git
- Recent git branches
- Git: Amend first commit
- Use git diff --no-index for regular diffs
- Lists files matching pattern in grep, ripgrep with `-l`
- List Java classes in JAR file
- Generate git stats
- Spark SQL array functions
- MySQL group_concat
- Use MySQL command line client to connect to a MySQL instance
- Rename Git branch
- View log of Docker container
- How to filter logs in AWS Cloudwatch
- HTTP headers are case insensitive
- Pretty print JSON with json.MarshalIndent
- JOINs nest left to right
- Implicit join = cross join = cartesian product = inner join with ON true
- Using regex capture groups to replace text in Go
- Union in SQL
- How to generate an ISO8601 date using date on macOS
- How to create a symbolic link to a directory
- Crosstabview in Postgres
- Find blocked queries in Postgres
- `tree -f` prints the full path of a file
- How to display all schemas in a Postgres database
- How to display all tables in a Postgres database
- pg_dump
- Using LIKE with a subquery in SQL
- Change owner of a schema in Postgres
- Copy table definition in Postgres
- Bash pattern to read from standard input or interactively in same program
- Execute command on Kubernetes pod
- How to grep twice in one pass
- In Go, range copies values from the slice it's iterating over
- Split a file in bash
- Current PID in Postgres
- Append to a file with tee
- tmux settings
- kubens
- Array literal in Go
- Find gap in continuous numbers in SQL using window functions
- Integer to hexadecimal in bash
- Remove last git commit
- Connect to a go-ethereum node
- git switch
- Canceling Postgres queries
- Viewing long running queries in Postgres
- Minify JSON using jq
- /usr/bin/strings
- Go's byte type is alias for uint8
- How to hold a pointer to a struct implementing an interface in Go
- How to run all tests except those matching a pattern
- Total line count of files with certain file ending
- Changing the keyboard repeat rate on macOS
- PostgreSQL connection string syntax
- CHECK constraints in Postgres
- Log everything from Postgres docker image
- Subquery returns null in SQL
- Content-Type and Content-Disposition HTTP headers
- The Permanent Redirect HTTP header
- SQLite CLI commands
- Cmd + arrow switches tab in iTerm
- Until in Bash
- Truncate a file
- Set commit date to now in git
- Squash commits in git
- Use pg_sleep in Postgres to simulate a slow query
- Use server_default for timestamps In SQLAlchemy
- go mod tidy cleans up unused dependencies
- Go methods that modify data should be defined with pointer receivers
- json_pp is a JSON pretty printer
- Exported methods and variables in Go are capitalized
- A Python decorator to profile a function
- `echo $?` returns the exit code of the previous command
- How to create a Kubernetes secret
- mock.side_effect can take an iterable in Python
- Getting the filename using Python's pathlib
- ThreadPoolExecutor in Python
- open . opens Finder in the current directory
- Aggrgeate statistics in AWS Cloudwatch