TIL is my collection of daily learnings. Each entry is brief, technical, and lightly edited.
Vim Jump to Previous Occurrence
In Vim Normal mode, * searches forward for the next occurrence of word. But what goes back? ...
TIL is my collection of daily learnings. Each entry is brief, technical, and lightly edited.
In Vim Normal mode, * searches forward for the next occurrence of word. But what goes back? ...
If I’ve defined a function in the Python REPL, I can read its definition with inspect.getsource. ...
In the Python REPL, the help function provides a help message about its argument. ...
Jira recently launched ‘Standup Mode’ feature, and love it! ...
I have a cron job that opens a program every day at a certain time. How can I also close it with a cron job? ...
My friend Josh recently wrote about a common mistake using pbcopy, Apple’s pasteboard utility. ...
Anytime Chrome loads a webpage, you can pause script execution without a debugger. ...
Exploring your JS dependencies locally is a great way to learn and experiment. Here’s how to load a dependency from your /node_modules directory into the Node REPL. $ node > cn = require('classnames') > cn("always", { never: false, sometimes: true }) 'always sometimes'
I’m reading Functional-Light JavaScript by Kyle Simpson, and learning a lot! Today I learned about the functional programming utility known as ‘identity’. Identity is a unary function that simply returns its argument. A simple idea that can be powerfully applied, as JavaScript coerces the returned argument to boolean: > const identity = (arg) => arg > ["", false, "keep", null, undefined, "these"].filter(identity) [ 'keep', 'these' ] I’ve done something similar for years by filtering to boolean, or writing my own (I didn’t know it had this name) anonymous identity function. ...
Today I solved a mystery: a file was being Git-ignored in a new project that didn’t have a .gitignore. Here’s me learning this by trying and failing to add it: $ git add destroy.sh The following paths are ignored by one of your .gitignore files: destroy.sh This output tells me some .gitignore is telling Git to ignore my script. Another way to confirm this is the check-ignore command: $ git check-ignore destroy.sh destroy.sh The output here is the match; a file named destroy.sh is indeed being ignored. But how? We can answer that question with the -v flag: ...
Don’t miss my next essay
Hear from me immediately when I post: no ads, unsubscribe anytime.