TIL
My personal Today I Learned inspired by jbranchaud/til
This a collection of small things that I learn on daily basis in the software engineering world. This is not only a record of my journey through tech but also a way to capture stuff that I find useful and don't want to forget. Finally, it's about practising writing.
89 TIL and counting...
Categories
Ansible
Awk
Curl
Docker
Elixir
- Stream between files
- Regex to match several things in no particular order
- Limit and control the output of IO.inspect/2-3
- Row-level locking
- Testing macros with Code.eval_string/3
nil
can give unexpected results combined with the Access protocol- Use
with
to pattern match only on a success case - Skip a test in ExUnit
- Find Erlang/OTP version for a BEAM file
Erlang
- Parse Code as String and Evalute it
- Fix shell after killing rebar3 shell
- Matching signed integers uses Two's complement
Git
- Show git history with only your commits (skipping merges)
- Effectively clone with long history
- Ignore local changes to files with update-index
- print-only-commit-summar
- See diff (checkout) for a single file between branches
- See diff between stashes (also for a single file)
- Use multiple keys for single Github account
- Revert commit without commiting
- Handle deleted by us/them in rebase
- Print files from a commit
- Update branch after force push
- Revert merge commit
- Turn object reference into SHA-1 (e.g. HEAD)
- Choose version of a file when both added
- List untracked files
- Copy current branch to the clipboard
- Checkout previous branch
- Grep commit message or contents
- Remove remote git tag
- List all modified files
- Checkout a file from another branch
- Undo rebase
- Work with multiple branches at a time
- Fixup and Autosquash
- Stage only deleted files
- Add only untracked files to the index
- Ignore files locally
- Remove file from repo without removing local copy
- Find out a tracking branch
- Stop tracking a file
- Prepare a single-file patch and apply it
- Push an empty commit
- List all conflicted files
- Checkout only a subdirectory
- Trun a repo subdirectory into a separate repo
GPG
JavaScript
Linux
Make
PostgreSQL
- Add a column to a busy table
- Update with join
- Using grouping sets in postgresql
- Check if a key exists in a JSON or array
- How to cross join tables?
- Select data based on timestamps range
- grouping with aggregate filtering (group by ... having)
- Add non-null column to a large table
- Check if JSONB array contains element
- How to check table's indices?
- Run PostgreSQL in a docker container
RabbitMQ
- Execute an Erlang snippet on a node in container
- Wait for the node/app to start/stop
- Connect to a node via remote shell
Sed
Shell
- find: Remove all files matching a pattern
- Test if a command or file exist
- Revert lines order
- See what processes are listening on TCP/UDP ports (OSX)
- Capture UDP data with nc
- Produce sequence of arbitrary strings
- Format a nice timestamp
- Increment a variable
- Iterate over pairs of items
- Print a range of commands from history
- Get the last match in a file and the following lines
- Remove string prefix and suffix
- Print lines from a file between patterns