RSSAmplifier

Blog

Tom Jakubowski

crystae.netRSS feed ↗7 posts

Latest posts

Edit shell variables interactively in zsh

When you write and edit a command to execute in zsh, you&rsquo;re using zshzle , its command line editor. zshzle sets up keybindings like <Ctrl-b> to move the cursor back one character, and <Ctrl-r> to search command history. In zsh, use zle&rsquo;s vared built-in to quickly set a variable&rsquo;s value interactively. vared pastes the variable&rsquo;s current value in a command line ready for you…

Minutes in a Year

How minutes are there in a year? Thanks to the solar system, it&rsquo;s complicated, but Google tells us one answer: 525960. That&rsquo;s equal to 8766 hours, or 365.25 24-hour days, which is the average number of minutes in a Julian calendar year. Google also gives a nice tip: in case 525960 is too long for you to remember, you can also use this approximation: 526000. When you just want to do…

Global find and replace in Vim

Use the quickfix list. :grep 'whatever' Fills the quickfix list with matches. Be sure and disable anything else which might stomp over the quickfix list, like ALE. Or, use :lgrep which fills the location list, which is scoped to a window. Acting on the results Run a command (search and replace, then write) for each file in the quickfix list: :cfdo %s/whatever/whomstever/g | w

Developing Python CLIs with Poetry

Poetry brings a simplified interface to Python&rsquo;s packaging and distribution system. It makes all the right things easy to do. Here&rsquo;s how you use it to develop a new Python CLI project. Getting started We&rsquo;ll make a CLI called hello-snake , in a package and project called snake . First run poetry new to create the project skeleton. tom@tomtop 🎪:~/tmp % poetry new snake Created…

Two shebang papercuts

You&rsquo;ve written a Ruby script on your Mac. The script demands great performance, so you add --enable=jit to its shebang : #!/usr/bin/env ruby --enable=jit print 'Hello, world!' You test on your Mac and the program greets everybody in record time. Ship it! Some time later, a user reports a problem. When they run the script, it seems rather slow; in fact, they&rsquo;ve waited for hours and no…

[activating prefrontal cortex]

Since last weekend, I&rsquo;d been meaning to write here. I have a few ideas to write about—some of them I&rsquo;ve even outlined and sketched diagrams for—but I haven&rsquo;t actually gotten to writing anything. It&rsquo;s bothered me all week. While stuck in bed reading my phone Friday morning, a Hacker News comment caught my eye. Quoting user stevewodil: If you&rsquo;re having trouble getting…

Healthchecking in Neovim

I like to use a few text editor plugins for finnicky things like &ldquo;smart&rdquo; code completion. These plugins often rely on some assumptions about the state of the computer outside of the editor: they might need a utility program installed (such as rls ), or a configuration file to exist in a certain location, or a certain environment variable to be set. When the computer&rsquo;s state is…