Tips
Short reminders on GitLab, Git, SQL, Docker, QA and front design, a few examples each, to be completed together.
Click a tab to change topic. In Front design, Let it snow covers the page with snow until clicked again, and a click on the wood leaves a bullet hole; nothing calls a server.
Tips
Short reminders, one tab per topic. To be completed together.- Open a merge request from the terminal
Push the branch, then create the MR with a title and a label.
glab mr create --fill --label "To Review"
- Read a failed job without the browser
The last pipeline of the branch, then the log of a job.
glab ci status glab ci trace unit-tests
- Suggest a fix in a review
A suggestion block in a diff comment: the author applies it in one click.
```suggestion:-0+0 assert response.status_code == 404 ```
- Lint a pipeline before pushing it
Catches a broken include or a wrong key without a pipeline run.
glab ci lint .gitlab-ci.yml
- Branch fresh from main
Fetch first, then branch from the remote main, not from a stale local one.
git fetch origin git switch -c feat/my-change origin/main
- Conventional commits
The type says what the change is, the release tool reads it.
feat: show the stock of open bugs fix: count a rejected bug as closed
- Rewrite the last commit
Forgot a file: stage it and amend, before pushing.
git add src/forgotten.py git commit --amend --no-edit
- Find the commit that broke a test
Git bisects the history, running the test at each step.
git bisect start HEAD v1.4.0 git bisect run pytest tests/unit -q
- Count before you look
A
COUNT(*)tells whether the rows you expect are there at all.SELECT status, COUNT(*) FROM orders GROUP BY status;
- Rows without a match
A
LEFT JOINand anIS NULL: the orders nobody invoiced.SELECT o.id FROM orders o LEFT JOIN invoices i ON i.order_id = o.id WHERE i.id IS NULL;
- Try a write, then undo it
In a transaction, check the result, then roll back.
START TRANSACTION; UPDATE stock_levels SET quantity = 0 WHERE id = 3; SELECT * FROM stock_levels WHERE id = 3; ROLLBACK;
- Which tables does a query read?
EXPLAINlists them, with the index used for each.EXPLAIN SELECT * FROM customers WHERE username = 'ada';
- Follow one service's logs
Only the last lines, then live.
docker compose logs -f --tail 50 api
- Open a shell in a container
Look at what the service really sees: files, variables, network.
docker compose exec api sh env | grep DB_
- Rebuild one service only
Faster than restarting the whole stack.
docker compose up -d --build console
- Free the disk
Stopped containers, dangling images and the build cache.
docker system df docker system prune
- Search first, then read
Look for an existing helper or test before writing a new one: reuse before writing.
- Never weaken a CI gate
A red gate is fixed, not silenced: no lowered threshold, no skipped job to get a merge.
- Official tooling, local identical to CI
Run the same hooks and the same commands as the pipeline before pushing.
mise run hooks:run mise run test
- No magic value
A business value gets a named constant that says what it means.
STALE_DAYS = 28 # not: if age > 28
- No masking fallback
A missing value fails loudly; a silent default hides the bug the test should have caught.
- A test writes its own data
Its own account, its own plus address; restore what it changed so the next run starts clean.
A canvas over the page, flakes drawn in a requestAnimationFrame loop; click again to stop.
Click the wood to shoot: the hole lands where the pointer is.
The same bullet hole as a static image on a transparent background (the checkerboard shows through): download the SVG.
An entry card with its orange Beta ribbon across the corner of the icon.