Code examples
Short, tested, copy-paste snippets for the things you look up every week. Each one is hand-written, checked for syntax, and free of tracking. You can also search for them directly, for example “python read a file” or “git undo last commit”.
- Python20 examples, e.g. read a file, write a file
- JavaScript18 examples, e.g. fetch json (get), post json with fetch
- TypeScript6 examples, e.g. interface vs type, generic function
- Bash13 examples, e.g. for loop, if statement
- Git16 examples, e.g. undo the last commit, amend the last commit
- SQL12 examples, e.g. select with where and order by, join types
- Go9 examples, e.g. read a file, http server
- Rust8 examples, e.g. read a file, struct with impl
- Java7 examples, e.g. read a file, stream: filter and map
- C#6 examples, e.g. read a file, linq: where and select
- C++6 examples, e.g. loop over a vector, read a file line by line
- PHP5 examples, e.g. query with pdo, read a file
- Ruby5 examples, e.g. read a file, map, select and reduce
- CSS11 examples, e.g. center a div, flexbox layout
- HTML7 examples, e.g. basic page skeleton, form with labels
- Docker5 examples, e.g. run a container, dockerfile for a node app
- Kubernetes3 examples, e.g. inspect pods, apply and delete manifests
- nginx4 examples, e.g. reverse proxy, redirect http to https
Command-line help too
Type any command into Zest, such as “tar” or “ffmpeg”, to see practical examples from tldr pages.