⏱️ Lectura: 12 min

An engineer can write SELECT 1 + 1; with no table behind it, and Postgres responds just the same, without complaining about the missing FROM. Will Keleher, a developer and author of that personal blog, published a list of twelve programming tricks he uses daily: terminal shortcuts, little-known git commands, SQL quirks, and native JavaScript functions that almost nobody takes advantage of.

📑 En este artículo
  1. TL;DR
  2. What Happened
  3. Context and Background
  4. Technical Details and Performance of the Programming Tricks
    1. Terminal and Shell
    2. Git
    3. SQL
    4. JavaScript and Node.js
  5. How to Get Started/Try It
  6. Impact and Analysis
  7. What’s Next
  8. Frequently Asked Questions
    1. What’s the difference between EXPLAIN and EXPLAIN ANALYZE?
    2. Are git log -S and git log -G the same thing?
    3. Do I need to know advanced SQL to use SELECT without FROM?
    4. Do fzf and atuin do the same thing?
    5. Why use ripgrep instead of grep?
    6. What is Promise.withResolvers?
  9. References

The central idea of the article is simple: much of an engineer’s productivity doesn’t come from mastering complex architectures, but from accumulating small programming tricks that require no prior mental infrastructure. Each one, on its own, saves seconds. Together, they change the pace of daily work.

TL;DR

  • Will Keleher published 12 everyday programming tricks on will-keleher.com: terminal, git, SQL, and JavaScript.
  • fzf turns Ctrl+R into a fuzzy history search; atuin replaces it with a queryable SQLite database.
  • PostgreSQL and MySQL let you use SELECT without FROM to test a standalone expression, like SELECT 1 + 1.
  • EXPLAIN ANALYZE runs the actual query with per-step timing, unlike EXPLAIN, which only estimates the plan.
  • git log -S finds commits that added or removed an exact string in the code (git pickaxe).
  • JavaScript now natively supports Array.flatMap, Object.entries, and Promise.withResolvers.
  • In Node.js, reusing an https.Agent with keepAlive reduces latency between requests to the same host.
  • At a previous company, Keleher shared one trick a day on Slack: just the right cadence to avoid overwhelming the team.

What Happened

Keleher describes these programming tricks as small, self-contained pieces of knowledge that don’t require understanding an entire system to be useful. You don’t need to know Python to run python3 -m http.server and spin up a file server in seconds, nor understand a compiler to know that rg (ripgrep) is faster than grep on a large repository.

The post gathers twelve concrete examples, grouped into four categories that show up every day in any developer’s work: terminal and shell, git, SQL, and JavaScript/Node.js. None requires reading extensive documentation; most are learned in a minute and used for years.

Terminal showing fuzzy history search with fzf
fzf turns Ctrl+R into a fuzzy search of the command history. Foto de Mohammad Rahmani en Unsplash

Context and Background

Keleher cites Julia Evans, known for her technical “zines,” as a direct inspiration, and sums up the post’s philosophy with a line from her: “small bits of knowledge are powerful! and fun! and approachable!!”

As an example of the kind of knowledge that motivates the post, Keleher mentions something that sounds familiar to any backend developer: an unexplained delay in a TCP connection that turns out to be Nagle’s algorithm interacting with the TCP_NODELAY option. Nobody teaches that detail in a formal course, but knowing it saves hours of debugging when it shows up.

At a previous company, Keleher shared one trick a day on Slack for the whole engineering team, mixing generic technical tips with company-specific ones (“to debug this problem, check this data source”; “this person knows a lot about this area and loves to help”). He found that one trick a day was just the right cadence: someone might already know nine out of ten, but that tenth one saved real time, without overwhelming the team with information.

Technical Details and Performance of the Programming Tricks

Terminal and Shell

The first group of programming tricks lives in the terminal. The Ctrl+R combination for searching command history is known to almost every developer, but few make the most of it. Installing fzf turns that search into a fuzzy search: you just type fragments in any order, without remembering the exact command. A step further is atuin, which replaces the shell’s flat history with an indexed, searchable SQLite database, with the option to sync it across machines.

For those who switch between searching commands from a specific directory and searching the entire history, the per-directory-history plugin lets you toggle between both modes with a key combination, without losing either history.

ToolWhen to Use ItAdvantageLimitation
Native Ctrl+RFreshly installed shell, no dependenciesRequires no installationSearches by exact substring match
fzfDaily-use terminal on any machineFuzzy search, integrates with more commands beyond just historyNeeds to be installed and kept up to date
atuinWorking across multiple machines and wanting shared historyHistory in SQLite, syncable, with usage statisticsAdds an extra binary and, if synced, depends on a server

Another habit change with direct impact: replacing find with the shell’s own globs. Most uses of find . -name "*.md" can be solved with a pattern like **/*.md, natively supported by zsh and, in bash, by enabling the globstar option:

shopt -s globstar
ls **/*.md

And to search content inside files, ripgrep (rg) replaces grep, ack, and ag in most modern workflows, respecting files ignored in .gitignore by default.

💡 Tip: Install fzf and try Ctrl+R in your usual shell: the difference is noticeable from the first history search you do.

Git

Two git tricks solve common problems with a single line. The first is git log -S, known as “git pickaxe”: it returns all the commits that added or removed an exact string in the code, valuable in a repository with years of history.

git log -S "MAX_RETRIES" --oneline
git log -G "MAX_RETRIES" --oneline

git log -G is similar but uses a regular expression and also shows commits where that line moved, not just where it was added or deleted.

The second trick is git checkout -, analogous to bash’s cd -: it returns to the previous commit or branch without needing to remember its name.

SQL

In PostgreSQL and MySQL, SELECT doesn’t need a FROM. It’s useful for testing how an expression or function behaves without setting up a test table:

SELECT 1 + 1;
SELECT TRUE <> NULL;
SELECT now();

The second command is a good reminder of a classic SQL trap: comparing against NULL returns neither true nor false, it returns NULL, because in three-valued logic any comparison against an unknown value is itself unknown.

The other SQL trick is EXPLAIN ANALYZE, supported by both PostgreSQL and MySQL. Unlike a plain EXPLAIN, which only estimates the execution plan, EXPLAIN ANALYZE actually runs the query and returns real timing for each step of the plan:

EXPLAIN ANALYZE
SELECT u.id, count(o.id)
FROM usuarios u
JOIN pedidos o ON o.usuario_id = u.id
WHERE u.creado_en > now() - interval '30 days'
GROUP BY u.id;

To confirm that the plan uses an index and not a full sequential scan, check the Index Scan line in the output (or its absence, replaced by Seq Scan).

⚠️ Careful: EXPLAIN ANALYZE runs the actual query, it doesn’t just plan it. For an UPDATE or DELETE in production, run the test inside a transaction you can roll back with ROLLBACK.

JavaScript and Node.js

Modern JavaScript already includes functions that replace entire libraries from a few years back: Array.prototype.flatMap, Object.entries, and more recently, Promise.withResolvers, which exposes a promise’s resolve and reject outside its constructor without needing external variables.

const { promise, resolve, reject } = Promise.withResolvers();
setTimeout(() => resolve("done"), 1000);
promise.then(console.log);

In Node.js, keeping an HTTPS connection open between requests to the same external resource directly reduces latency, because it avoids repeating the TLS handshake on every call. This is achieved by creating an https.Agent with keepAlive enabled and passing it explicitly to each fetch call:

import https from "node:https";

const agent = new https.Agent({ keepAlive: true });

async function obtenerPerfil(userId) {
  const res = await fetch(`https://api.miempresa.com/users/${userId}`, {
    agent,
  });
  return res.json();
}
JavaScript code and terminal showing programming tricks in use
Promise.withResolvers is now part of the JavaScript standard, no extra libraries needed. Foto de Fotis Fotopoulos en Unsplash

Another programming trick with direct impact on observability: using base-10 logarithm to group metrics into buckets when the value range is very wide, for example the number of users per account, which can range from 1 to 100,000:

const bucket = Math.floor(Math.log10(userInGroupCount));
metrics.increment("cuentas_activas", { bucket });

With this, an account with 8 users falls into bucket 0, one with 80 into bucket 1, one with 8,000 into bucket 3. Without the logarithm, a linear histogram would be dominated by large accounts and would hide the real distribution.

Finally, in regular expressions, \b (the word boundary assertion) lets you match the exact start or end of a word without capturing partial matches inside a longer word:

/\bcat\b/.test("category");  // false
/\bcat\b/.test("the cat sat"); // true

How to Get Started/Try It

Installing the post’s three core tools (fzf, ripgrep, and atuin) takes less than five minutes on any operating system.

fzf

# macOS (Homebrew)
brew install fzf
$(brew --prefix)/opt/fzf/install

# Linux (Debian/Ubuntu)
sudo apt install fzf

# Windows (winget)
winget install fzf

ripgrep

# macOS
brew install ripgrep

# Linux (Debian/Ubuntu)
sudo apt install ripgrep

# Windows (winget)
winget install BurntSushi.ripgrep.MSVC

atuin

# macOS and Linux
curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh | sh

# Windows (inside WSL, no native build)
wsl curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh | sh

To enable zsh’s advanced autocompletion, which isn’t turned on by default, add this to your .zshrc:

if type brew >/dev/null 2>&1; then
  FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
fi
autoload -Uz compinit
compinit

To confirm fzf is active on Ctrl+R, just open a new terminal, type a fragment of a command you used before, and press Ctrl+R: if a filterable list with highlighted matches appears, the integration works.

Impact and Analysis

The value of these programming tricks isn’t in any single one, but in the accumulation. Keleher argues that at a company, much of the highest-impact knowledge takes this same form: small, specific, and without much infrastructure behind it. “To debug this problem, check this data source” or “to do a hot restart of this service, run this command” are worth just as much as knowing that rg is faster than grep.

The practice of sharing one trick a day on Slack, mixing generic technical tips with company-specific ones, remained sustainable for a long time on Keleher’s team. The reason he gives is concrete: even if someone already knew nine out of ten shared tricks, the tenth usually saved them real time, and the daily cadence, neither more frequent nor more spaced out, kept people from being overwhelmed with information.

An honest limitation of this approach: not all programming tricks transfer across domains. EXPLAIN ANALYZE is useless if the team works with a document database with no relational query planner, and git log -S loses value in very young repositories without enough history to explore. Keleher’s list makes sense for teams that work with terminal, git, relational SQL, and JavaScript daily, but a team focused on embedded firmware would need its own list.

💭 Key takeaway: the highest-return knowledge on a team is usually company-specific, not generic: where to find the data to debug X, who knows about Y, what command solves Z.

What’s Next

For remote LATAM teams, replicating the “one trick a day” practice in a Slack or Discord channel is a cheap way to raise the overall skill level without relying on formal training sessions. The key, according to the experience described in the post, is keeping the cadence low: one trick a day, not a full list all at once, which gets forgotten within hours.

The original post also works as a reminder that it’s worth keeping your own record of these findings, even if informal, because most of the highest-impact programming tricks are learned by accident, while solving a specific problem, and get forgotten if they aren’t written down somewhere.

flowchart TD
A["Programming Tricks"] --> B["Terminal and Shell"]
A --> C["Git"]
A --> D["SQL"]
A --> E["JavaScript and Node"]
B --> F["fzf, atuin, ripgrep"]
C --> G["git log -S, git checkout -"]
D --> H["SELECT without FROM, EXPLAIN ANALYZE"]
E --> I["flatMap, https.Agent, Promise.withResolvers"]

📖 Summary on Telegram: View summary

Try it yourself: install fzf with brew install fzf or sudo apt install fzf and press Ctrl+R on your next history search.

Frequently Asked Questions

What’s the difference between EXPLAIN and EXPLAIN ANALYZE?

EXPLAIN only shows the estimated plan the engine would use, without running the query. EXPLAIN ANALYZE actually runs the query and adds real timing for each step of the plan.

Are git log -S and git log -G the same thing?

No. -S finds commits that added or removed an exact string. -G uses a regular expression and also detects when that line moved, not just when the number of its occurrences changed.

Do I need to know advanced SQL to use SELECT without FROM?

No. It’s actually useful for the opposite: testing an expression, a function, or an operator without needing a real table on hand.

Do fzf and atuin do the same thing?

They overlap but aren’t the same. fzf adds fuzzy search on top of the shell’s existing history. atuin replaces the entire history with a SQLite database, with the option to sync it across machines.

Why use ripgrep instead of grep?

For speed on large repositories and because it respects .gitignore rules by default, avoiding searches inside folders like node_modules without extra configuration.

What is Promise.withResolvers?

A static method on Promise that returns the promise along with its resolve and reject functions already extracted, without needing to declare them as external variables inside the constructor.

References

📱 Do you like this content? Follow @programacion on Telegram for daily tech content in Spanish: quick summaries, fresh content every day.

Imagen destacada: Foto de Fotis Fotopoulos en Unsplash

Categories: Noticias Tech

Andrés Morales

Developer and AI researcher. Writes about language models, frameworks, developer tooling, and open source releases. Covers ML papers, the tech startup ecosystem, and programming trends.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.