首页›发现›编程›Julia Evans

Julia Evans

Atom运行正常
jvns.ca·编程·英语
访问网站
文章数20
更新频率近 8 周没有更新
最近抓取22分钟前
订阅方式Atom
订阅地址https://jvns.ca/atom.xml

最近的文章

订阅后,这些文章和以后的新文章都会出现在你的阅读器里

Replacing the old battery on rechargeable bike lights

AI 摘要The author repaired their decade-old rechargeable bike lights, which only held a charge for about 5 minutes, by replacing the lithium coin cell batteries (identified as LIR2477 with the help of an LLM). Following a desoldering guide and friends' advice, they removed the old batteries at a local queer makerspace, ordered replacements and silicone glue from AliExpress, soldered in the new batteries, and glued the lights back together. The repair succeeded—the lights now work for nighttime biking—and cost about $20 CAD total, which the author found rewarding despite having minimal electronics experience.

Some more things about Django I've been enjoying

AI 摘要The author describes learning to build backend-rendered websites with Django in a '2010 style' after years of frontend-heavy approaches, and highlights features they enjoy like query builders, template filters (especially `querystring`), and automatic database migrations. They dislike organizing views with inheritance, preferring function-based code instead, and are still figuring out how to reason about Django performance—notably discovering they had accidentally disabled the cached template loader, whose re-enablement significantly improved the site's request throughput.

Learning a few things about running SQLite

AI 摘要The author shares lessons learned from using SQLite as the database for a Django site, including how running ANALYZE dramatically sped up a slow full-text search query and how long-running cleanup DELETEs can cause other workers to time out and crash since SQLite allows only one writer at a time. They also describe their backup approaches using restic and Litestream, along with tricks like splitting tables across multiple database files. Despite these challenges, they find SQLite works well for small sites, though the experience has given them more appreciation for databases like Postgres.

Moving away from Tailwind, and learning to structure my CSS

AI 摘要The author describes migrating several of their small sites from Tailwind CSS to semantic HTML with vanilla CSS, explaining how Tailwind had taught them useful systems (resets, color palettes, font scales, utility classes) that they adapted while restructuring their CSS around components, base styles, spacing conventions, flexible grid layouts, and esbuild. They cite reasons for leaving Tailwind, including its growing reliance on build systems, their own improved CSS skills, Tailwind's limitations for unusual designs, and the pain of maintaining mixed codebases. Finally, they reflect on learning to respect CSS as a genuinely hard and powerful technology rather than devaluing it, and mention modern features like @layer, @scope, container queries, and subgrid that they hope to explore.

Links to CSS colour palettes

AI 摘要After deciding to stop using Tailwind CSS for new projects, the author missed its convenient color palette and asked on Mastodon for alternatives. This post compiles links to their favorite palettes (such as uchū, flexoki, and reasonable colours) as well as other palettes, color palette generators, and color tools like colorhexa and oklch resources.

Testing Vue components in the browser

AI 摘要The author describes their approach to end-to-end testing of Vue components entirely in the browser without Node.js, using QUnit along with a custom mountComponent helper, SQL-based fixture data reset via a dev server endpoint, and a polling waitFor function to handle asynchronous rendering. They share practical challenges encountered along the way, such as identifying the right DOM conditions to wait for, dispatching the proper events when filling out forms, adding CSS classes for test targeting, and using Chrome's built-in code coverage tool. The experiment was enjoyable and left the author considering Testing Library and how to eventually integrate browser-based tests into CI.

Examples for the tcpdump and dig man pages

AI 摘要The author added or improved examples in the man pages for dig and tcpdump, aiming to provide the most basic usage examples for beginners and infrequent users. They explain that working on official documentation is worthwhile because maintainer review ensures accuracy and teaches useful features, such as using -v with tcpdump -w to see a live packet count. To avoid learning the difficult roff language, they wrote a custom Markdown-to-roff conversion script, and they reflect on the complex history of man pages and documentation differences between BSD and Linux.

Notes on clarifying man pages

AI 摘要After working on the Git man pages, the author reflects on what makes man pages easier to use, gathering examples of good practices such as rsync's terse OPTIONS SUMMARY, strace's categorized options, Perl's cheat sheet, OpenBSD's examples, and curl's per-option examples. The post also discusses improvements like tables of contents and internal hyperlinks in HTML versions, using tables for scannability, and notes the GNU project's preference for info manuals over man pages. The author concludes that man pages are an interestingly constrained format, loves examples, and invites readers to share other well-designed man pages.

Some notes on starting to use Django

AI 摘要The author shares their positive first experience learning Django, noting they prefer it over Rails because it's more explicit and less 'magical,' making it easier to return to a project after months away. They highlight Django's built-in admin interface, ORM with automatic migrations, good documentation, 'batteries-included' features like email support, and successful use of SQLite in production. The main frustration so far is the settings.py file, where typos in global variable names aren't caught by language server tooling.

A data model for Git (and other docs updates)

AI 摘要The author describes their experience improving Git's official documentation, including writing a new 1600-word 'data model' document explaining core concepts like objects, references, and the index, and updating the man pages for git add, git checkout, git push, and git pull. To make changes evidence-based rather than relying on expert opinion, they recruited about 80 test readers via Mastodon to identify confusing terminology, sentences, and inconsistencies in the existing docs. They also share practical notes on Git's contribution process, praising tools like GitGitGadget (which converts GitHub PRs to email patches) and the welcoming community on Git's Discord server.

Notes on switching to Helix from vim

AI 摘要The author shares notes from three months of using the Helix text editor after 20 years with Vim/Neovim, motivated mainly by Helix's built-in language server support and minimal configuration needs. They praise features like the contextual search, quick reference popups, and multiple cursors, while noting annoyances such as poor text reflow, no persistent undo, and occasional panics. Switching proved easier than expected—learning the 'Helix way' worked better than mimicking Vim keybindings—though they might still return to Vim someday.

New zine: The Secret Rules of the Terminal

AI 摘要The author announces the release of a new zine, "The Secret Rules of the Terminal," which explains how the terminal's four components (shell, terminal emulator, programs, and TTY driver) fit together and why the terminal behaves in confusing, inconsistent ways. The zine covers practical knowledge like escape codes, shell configuration, and debugging tricks, along with lessons the author learned despite 20 years of daily terminal use. It's available for $12 as a PDF or a print version shipping in August, with contributions from several collaborators including a technical review by PuTTY's author.

Using `make` to compile C programs (for non-C-programmers)

AI 摘要This article is a beginner-friendly guide for non-C-programmers on compiling C programs from source using `make`, covering steps like installing a compiler, installing dependencies, running `./configure`, and running `make`. It explains how to fix common compiler and linker errors by passing flags through environment variables like `CPPFLAGS` and `LDLIBS`, and shares tips such as building a single file with `make $FILENAME` and consulting other packaging systems' build files for clues. The author concludes that understanding some C compilation basics is useful even for people who never plan to write C programs.

Standards for ANSI escape codes

AI 摘要The article explains ANSI escape codes—the sequences terminals and programs use to communicate things like colors, cursor movement, and clipboard access—and surveys the standards that cover them, including ECMA-48, xterm control sequences, and the terminfo database. Because escape codes are only partially standardized, they can be unreliable and frustrating to debug, which has led some programs to abandon terminfo in favor of hardcoding a widely supported common set of codes. The author hopes that a clearer standards landscape, similar to how web standards improved over time, could eventually make terminal features more reliable and easier to adopt.

How to add a directory to your PATH

AI 摘要This article provides complete, step-by-step instructions for adding a directory to your PATH, covering how to identify your shell (bash, zsh, or fish), locate the correct config file, determine which directory to add, edit the config, and restart the shell. It also explains common gotchas, such as running the wrong program version, handling programs launched outside the shell (like cron jobs or IDEs), dealing with duplicate PATH entries, and losing shell history when reloading the config.

Some terminal frustrations

AI 摘要The author ran a terminal survey in which 1600 respondents—most of them experienced users, with 40% having used the terminal for 21+ years—shared their biggest frustrations, which the author categorized using a custom-built tool. The top complaints included remembering syntax for CLI tools, difficulty switching between different systems and shells, color configuration problems, inconsistent keyboard shortcuts (especially for copy/paste), and various copy-paste issues. Other notable frustrations covered discoverability, steep learning curves, shell history limitations, bad documentation, and the terminal feeling outdated due to legacy decisions.

What's involved in getting a "modern" terminal setup?

AI 摘要The article explains what makes up a 'modern' terminal experience—features like infinite shell history, 24-bit color, good autocomplete, and clipboard integration—and why achieving one is harder than it seems, since popular defaults like bash, zsh, and vim require significant configuration. The author describes their own setup (fish shell, a 24-bit color terminal emulator, and neovim with base16 theming) that took 20 years to build, and suggests low-effort alternatives such as oh-my-zsh, kitty/alacritty/ghostty, or micro and helix. They conclude that terminal components interact in unexpected ways, so it is best to make changes slowly and accept that no configuration will ever be perfectly stable.

"Rules" that terminal programs follow

AI 摘要The article describes a set of unwritten, descriptive 'rules' that terminal programs tend to follow despite there being no formal standards for their behavior, such as Ctrl-C quitting noninteractive programs, pressing q exiting TUIs, Ctrl-D exiting REPLs, sticking to 16 ANSI colors, mimicking readline keybindings like Ctrl-W deleting the last word, disabling colors when output goes to a pipe, and using '-' to represent stdin/stdout. The author explains that many of these conventions aren't laws of nature but are explicitly implemented by each program, often mimicking default OS behavior in cooked mode. Learning these rules took years of subconscious pattern recognition, and the goal of writing them down is to help others understand what behavior to expect from terminal programs and to more easily categorize exceptions.

Why pipes sometimes get "stuck": buffering

AI 摘要The article explains that pipes like 'tail -f file | grep thing1 | grep thing2' can appear 'stuck' because programs such as grep use block buffering when writing to a pipe or file (saving up ~8KB before writing) but switch to line buffering when writing to a terminal, which is why adding a second grep makes output disappear. It catalogs which common commands and programming languages buffer their output along with the flags that disable buffering, notes that pressing Ctrl-C on a pipe loses buffered data, and presents several workarounds such as grep's --line-buffered flag, using awk, stdbuf, or unbuffer.

Importing a frontend Javascript library without a build system

AI 摘要The article explains how to import frontend JavaScript libraries without using a build system, covering the three types of files libraries may provide: classic global-variable scripts, ES modules, and CommonJS modules. It describes how to identify each type by inspecting the library's NPM build and package.json, and how to use them via a simple