Creating a minimal config specifically for git [1] commits has made running
git commit much more pleasant. It starts up Much faster, and has all
of the parts of my config that I use while making a git commit. The one
thing that I often use is autocomplete, for things coming from elsewhere
in the tmux session. For this cmpe-tmux specifically is super
helpful.
The other thing that is engrained into my muscle memory is jj
for escape. For that I went agead and added my settings and keymap
with no noticable performance hit.
Here is the config that has taken
~/.config/nvim/init-git.vim
source ~/.config/nvim/settings.vim
source ~/.config/nvim/keymap.vim
source ~/.config/nvim/git-plugins.vim
lua require'waylonwalker.cmp'
~/.config/nvim/git-plugins.vim
call plug#begin('~/.local/share/nvim/plugged')
" cmp
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-calc'
Plug 'andersevenrud/compe-tmux', { 'branch': 'cmp' }
call plug#end()
~/.gitconfig
[core]
editor = nvim -u ~/.config/nvim/init-git.vim
References:
[1]: /glossary/git/
GitHub Stars
GitHub stars posts
1859 posts
latest post 2026-05-24
Publishing rhythm
Check out photoview [1] and their project photoview [2].
Photo gallery for self-hosted [3] personal servers
References:
[1]: https://github.com/photoview
[2]: https://github.com/photoview/photoview
[3]: /self-host/
I like mizlan’s [1] project iswap.nvim [2].
Interactively select and swap function arguments, list elements, and much more. Powered by tree-sitter.
References:
[1]: https://github.com/mizlan
[2]: https://github.com/mizlan/iswap.nvim
For an embarassingly long time, til today, I have been wrapping my dict
gets with key errors in python. I’m sure I’ve read it in code a bunch
of times, but just brushed over why you would use get. That is until I
read a bunch of PR’s from my buddy Nic and notice that he never gets
things with brackets and always with .get. This turns out so much
cleaner to create a default case than try except.
Example # [1]
Lets consider this example for prices of supplies. Here we set a variable of
prices as a dictionary of items and thier price.
prices = {'pen': 1.2, 'pencil', 0.3, 'eraser', 2.3}
Except KeyError # [2]
What I would always do is try to get the key, and if it failed on KeyError, I
would set the value (paper_price in this case) to a default value.
try:
paper_price = prices['paper']
except KeyError:
paper_price = None
.get # [3]
What I noticed Nic does is to use get. This feels just so much cleaner that
it’s a one liner and feels much easier to read and understand that if there is
no price for paper we set it to None.
paper_price = prices.get('paper', None)
We can just as easily set the default to other values. Let’s consider sales
for instance. If there is not a record f...
I was listening to shipit37 [1] with Vincent
Ambo talking about building fully declaritive systems with nix. Vincent is
building out Nixery and strongly believes that standard versioning systems are
flawed. If we have good ci setup, and every commit is a good commit the idea
of a release is just some arbitrary point in history that the maintainer
decided was a good time to release, and has less to do about features and
quality.
Since many things still want to see a version number, there is one automatic
always increasing number that is a part of every single git [2] repo, and that is
the commit count. Nixery is versioned by commit count. When counting on the
main branch there is no way for two points in time to share the same version.
The git cli will count all commits by default so you have to be careful to only
include commits from the branch you want to version/release from.
git rev-list main --count
References:
[1]: https://changelog.com/shipit/37
[2]: /glossary/git/
Check out rhysd [1] and their project conflict-marker.vim [2].
Weapon to fight against conflicts in Vim.
References:
[1]: https://github.com/rhysd
[2]: https://github.com/rhysd/conflict-marker.vim
BeautifulSoup is a DOM like library for python. It’s quite useful to
manipulate html [1]. Here is an example to find_all html headings. I stole
the regex from stack overflow, but who doesn’t.
Make an example # [2]
sample.html
Lets make a sample.html file with the following contents. It mainly has
some headings, <h1> and <h2> tags that I want to be able to find.
<!DOCTYPE html>
<html lang="en">
<body>
<h1>hello</h1>
<p>this is a paragraph</p>
<h2>second heading</h2>
<p>this is also a paragraph</p>
<h2>third heading</h2>
<p>this is the last paragraph</p>
</body>
</html>
Get the headings with BeautifulSoup # [3]
Lets import our packages, read in our sample.html using pathlib and find all
headings using BeautifulSoup.
from bs4 import BeautifulSoup
from pathlib import Path
soup = BeautifulSoup(Path('sample.html').read_text(), features="lxml")
headings = soup.find_all(re.compile("^h[1-6]$"))
And what we get is a list of bs4.element.Tag’s.
>> print(headings)
[<h1>hello</h1>, <h2>second heading</h2>, <h2>third heading</h2>]
I recently added a heading_link plugin to markata, you might notice the
🔗’s next to each heading on this page, that is powered by this exact
techniq...
I like Textualize’s [1] project rich-cli [2].
Rich-cli is a command line toolbox for fancy output in the terminal
References:
[1]: https://github.com/Textualize
[2]: https://github.com/Textualize/rich-cli
I keep my nodes short and sweet. They do one thing and do it well. I
turn almost every DataFrame transformation into its own node. It makes
it must easier to pull catalog entries, than firing up the pipeline,
running it, and starting a debugger. For this reason many of my nodes
can be built from inline lambdas.
Examples # [1]
Here are two examples, the first one lambda x: x is sometimes referred
to as an identity function. This is super common to use in the early
phases of a project. It lets you follow standard layering conventions,
without skipping a layer, overthinking if you should have the layer or
not, and leaves a good placholder to fill in later when you need it.
Many times I just want to get the data in as fast as possible, learn
about it, then go back and tidy it up.
from kedro.pipeline import node
my_first_node = node(
func=lambda x: x,
inputs='raw_cars',
output='int_cars',
tags=['int',]
)
my_first_node = node(
func=lambda cars: cars[['mpg', 'cyl', 'disp',]].query('disp>200'),
inputs='raw_cars',
output='int_cars',
tags=['pri',]
)
Note: try not to take the idea of a one liner too far. If your
one line function wraps several lines down it probably deserv...
stow -R --simulate -vvv git
I’ve never found a great use for a global .gitignore file. Mostly I fear
that by adding a lot of the common things like .pyc files it will be missing
from the project and inevitably be committed to the project by someone else.
Personal Tools # [1]
Within the past year I have added some tools to my personal setup that are not
required to run the project, but works really well with my setup. They are
direnv and pyflyby. Since these both support project level configuration,
are less common, and not in most .gitignore templates they make for great
candidates to add to a global .gitignore file.
create the config # [2]
Like any .gitignore it supports gits wildignore syntax. I made a
~/dotfiles/git/.global_gitignore file, and added the following to it.
.envrc
.pyflyby
.copier-defaults
.venv*/
.python-version
markout
.markata.cache
Once I had this file, I stowed it into ~/.global_gitignore.
cd ~/dotfiles/
stow git
Always stow your dotfiles, don’t set yourself up for wondering why your next
machine is not working right.
stow note # [3]
Note, the reason that it is a ~/.global_gitignore and not a ~/.gitignore is
that I was unable to stow a .gitignore file. They must be ignored by
...
Today I discovered a sweet new cli for compressing images.
squoosh cli [1]
is a wasm powered cli that supports a bunch of formats that I would want to
convert my website images to.
from the future
> Unfortunately, due to a few people leaving the team, and staffing issues
resulting from the current economic climate (ugh), I’m deprecating the
CLI and libsquoosh parts of Squoosh. The web app will continue to be
supported and improved. I know that sucks, but there simply isn’t the
time & people to work on this. If anyone from the community wants to fork
it, you have my blessing.
https://github.com/GoogleChromeLabs/squoosh/pull/1321
Web App # [2]
First the main feature of squoosh is a web app [3] that
makes your images smaller right in the browser, using the same wasm. It’s
sweet! There is a really cool swiper to compare the output image with the
original, and graphical dials to change your settings.
CLI # [4]
What is even cooler is that once you have settings you are happy with and are
really cutting down those kb’s on your images, there is a copy cli command
button! If you have npx (which you should if you have nodejs and npm) already
installed it just works without instal...
As you work on your kedro projects you are bound to need to add more
dependencies to the project eventually. Kedro uses a fantastic command
pip-compile under the hood to ensure that everyone is on the same version of
packages at all times, and able to easily upgrade them. It might be a bit
different workflow than what you have seen, let’s take a look at it.
git status # [2]
Before you start mucking around with any changes to dependencies make sure that
your git status is clean. I’d even reccomend starting a new branch for this,
and if you are working on a team potentially submit this as its own PR for
clarity.
git status
git checkout main
git checkout -b add-rich-dependency
requirements.in # [3]
New requirements get added to a requirements.in file. If you need to specify
an exact version, or a minimum version you can do that, but if all versions
generally work you can leave it open.
# requirements.in
rich
Here I added the popular rich package to my requirements.in file. Since
I am ok with the latest version I am not going to pin anything, I am going to
let the pip resolver pick the latest version that does not conflict with any of
my dependencies for me.
build-reqs # [4]
...
I am a huge believer in practicing your craft. Professional athletes
spend most of their time honing their skills and making themsleves
better. In Engineering many spend nearly 0 time practicing. I am not
saying that you need to spend all your free time practicing, but a few
minutes trying new things can go a long way in how you understand what
you are doing and make a hue impact on your long term productivity.
What is Kedro [1]
Start practicing # [2]
practice building pipelines with #kedro today
Go to your playground directory, and if you don’t have one, make one.
cd ~/playground
get pipx # [3]
Install pipx in your system python. This is one of the very few, and
possibly the only python library that deserves to be installed in your
system directory, primarily because its used to sanbox clis in their own
virtual environment [4] automatically for you.
pip install pipx
make a new project # [5]
From inside your playground directory, start your new kedro project.
This is quite simple and painless. So much so that if you mess this one
up doing something wild, it might be easier to make a new one that
fixing the wild one.
pipx run kedro new
# answer the questions it asks
I u...
If you’re into interesting projects, don’t miss out on jupyterlite [1], created by jupyterlite [2].
Wasm powered Jupyter running in the browser 💡
References:
[1]: https://github.com/jupyterlite/jupyterlite
[2]: https://github.com/jupyterlite
I’m really excited about nbterm [1], an amazing project by davidbrochart [2]. It’s worth exploring!
Jupyter Notebooks in the terminal.
References:
[1]: https://github.com/davidbrochart/nbterm
[2]: https://github.com/davidbrochart
I came across stylish.nvim [1] from sunjon [2], and it’s packed with great features and ideas.
Stylish UI components for Neovim
References:
[1]: https://github.com/sunjon/stylish.nvim
[2]: https://github.com/sunjon
One of the first things I noticed broken in my terminal based workflow moving
from Windows wsl to ubuntu was that my clipboard was all messed up and not
working with my terminal apps. Luckily setting tmux and neovim to work with
the system clipboard was much easier than it was on windows.
First off you need to get xclip if you don’t already have it provided by your
distro. I found it in the apt repositories. I have used it between Ubuntu
18.04 and 21.10 and they all work flawlessly for me.
I have tmux setup to automatically copy any selection I make to the clipboard
by setting the following in my ~/.tmux.conf. While I have neovim open I need
to be in insert mode for this to pick up.
# ~/tmux.conf
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
To get my yanks to go to the system clipboard in neovim, I just added
unnamedplus to my existing clipboard variable.
# ~/.config/nvim/init.vim
set clipboard+=unnamedplus
If you need to copy something right from the terminal you can use xclip
directly. ...
With the latest version of minecraft it requires a very new, possibly
the latest, version of java. Lately we have been getting into modded
minecraft and I maintain the server for us. It’s been tricky to say the
least. One hurdle I recently hit involves having the wrong version of
java.
I was getting this error trying to get a 1.12.2 forge server running.
Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader ‘bootstrap’)
In researching our errors, I found this on a forum.
Pre-1.13 Forge only works with Java 8.
I don’t write java, or really know how to manage different versions of
java, but I have nixpkgs installed and it has a ton of odd stuff like
this readily available, so
searching nixpkgs [1]
landed me with this.
nix-env -iA nixpkgs.jdk8
once I had this installed I then just changed out java for the full path
to my new nixpkgs.jdk8 java and it worked.
/home/walkers/.nix-profile/bin/java -server -Xms${MIN_RAM} -Xmx${MAX_RAM} ${JAVA_PARAMETERS} -jar ${SERVER_JAR} nogui
I don...
I have added a hotkey to my copier template setup to quickly access all my
templates at any time from tmux. At any point I can hit <c-b><c-b>, thats
holding control and hitting bb, and I will get a popup list of all of my
templates directory names. Its an fzf list, which means that I can fuzzy
search through it for the template I want, or arrow key to the one I want if I
am feeling insane. I even setup it up so that the preview is a list of the
files that come with the template in tree view.
bind-key c-b popup -E -w 80% -d '#{pane_current_path}' "\
pipx run copier copy ~/.copier-templates/`ls ~/.copier-templates |\
fzf --header $(pwd) --preview='tree ~/.copier-templates/{} |\
lolcat'` . \
"
I’ve had this on my systems for a few weeks now and I am constantly using it
for my tils [1],
blogs [2], and my .envrc file that goes into
all of my projects to make sure that I have a virtual environment [3] installed and
running any time I open it.
[4]
References:
[1]: https://waylonwalker.com/til/
[2]: https://waylonwalker.com/archive/
[3]: /virtual-environment/
[4]: https://images.waylonwalker.com/copier-templates-tmux-popup.png