- Javascript Module
JavaScript programs start off pretty small almost every time. Not until your project grows and grows so large that your scripts may start to look like spaghetti code. At this point, your code has to be broken down into separate modules that can be imported where needed. The good news is that modern…
- Algorithm interview – Big O
Big O is about how long an algorithm takes to run from start to end and how well it scales based on the size of the input or dataset. Big O is mostly measured based on the worst-case scenario even though some algorithms might finish early based on some logic. Here is another graph […]
- Postgres – Data Types
The choices you cannot cheaply undo later. `text` versus `varchar(n)` and why the length limit buys nothing, `numeric` for money and never a float, `timestamptz` versus `timestamp` and what actually gets stored, `uuid` alongside an integer key rather than instead of it, arrays, and why StayHub stores its enums as varchar. With a mapping table to Python and Java types.
- Postgres – Databases, Schemas, Roles and Privileges
A database holds schemas, a schema holds tables, and a role is both a user and a group. Creating an application account that is not a superuser: what `public` grants you by default and why the first thing to do is revoke it, GRANT versus ALTER DEFAULT PRIVILEGES and why the second one is the one people forget, search_path, and the owner/app/read-only split worth having on day one.
- Postgres – psql and the Tools You Actually Use
psql is the tool that ships with the database and the one every answer online assumes. The meta-commands worth memorising — \d, \d+, \di, \l, \dn, \x, \timing — the connection URI in full, running a file with ON_ERROR_STOP so a migration does not half-apply, and a .psqlrc that makes the shell bearable. Plus where a GUI still wins.