Skip to content

Instantly share code, notes, and snippets.

View jeffkreeftmeijer's full-sized avatar
🦞

Jeff Kreeftmeijer jeffkreeftmeijer

🦞
View GitHub Profile
@jeffkreeftmeijer
jeffkreeftmeijer / .envrc
Last active April 29, 2024 19:14
htmlize-stylesheet
use flake .

Run Git commands from outside a repository directory

There are multiple options to run a Git command from outside of a repository directory[fn:todo]. From least to most flexible, these are the --git-dir -C and --work-tree options.

Manage user environments with Nix and Home Manager

Nix is a functional package manager for Linux and macOS which helps build reproducable setups.

“Fix” the tab key for visibility cycling in Org and Evil mode

Build Terminal Emacs from source on macOS

I’m currently running Emacs 29 on macOS’s Terminal.app, built from source without a window system.

linguist.el: A language modes pack for Emacs

Linguist is a language modes pack for Emacs, inspired by vim-polyglot.

Hiding blank lines while collapsing Org document sections in Emacs

The org-cycle-separator-lines variable determines hwo Org hides trailing lines when collapsing document sections. It’s options are confusing at first glance, as it takes either a positive or negative number, but should make more sense with some examples.

;; Disable package.el in favor of straight.el
(setq package-enable-at-startup nil)
@jeffkreeftmeijer
jeffkreeftmeijer / job.rb
Last active August 6, 2021 19:44
job.rb
loop do
retries = 0
begin
# TODO fetch and run a job
rescue StandardError => error
if retries < 10
sleep(retries * 10)
retries += 1

Subshells

A subshell creates a separate instance of the command processor, or a subprocess of the parent shell. Although a subshell is started in its parent’s working directory, directory changes made within the subshell don’t carry over to its parent. This makes subshells ideal for running one-off commands in a different directory:

$ pwd
/Users/jeffkreeftmeijer/rust/conway/
$ (cd www && npm install)
[...]
$ pwd
/Users/jeffkreeftmeijer/rust/conway/