Blog

Full Blog Posts

341 posts latest post 2026-05-11
Publishing rhythm
Feb 2026 | 6 posts

I just added react-headroom to my site

It was so easy to get a professional looking navbar with just 3 lines of code. This package seriously is so usable on mobile it is ridiculous. I found this package from day-4 [1] of the 100 days of gatsby challenge. It is by the wonderful man who brought us gatsbyjs Kyle Mathews, so you know its gotta be good. install react-headroom # [2] installation is easy npm i react-headroom Import Headroom # [3] There was no instructions for es6 style imports that are common with gatsbyjs sites like mine, but it was intuitive to figure out. import Headroom from 'react-headroom' Using Headroom # [4] Simply wrap your existing content, Nav in my case, with the <Headroom /> component and your off to the races. The content will pop back into view when you scroll past then back up. <Headroom> <-- Your content goes here --> </Headroom> See it in action # [5] I think this simple package completely changes the ux of your site on mobile. You can get that sticky nav out of the way, but its still...

Serverless things to investigate

Social Automation # [1] Zappier # [2] - Free - only one step is free - can take rss to social Automate.io # [3] - Form submission # [4] https://getform.io Free to get started https://formkeep.com/?#pricing [5] Free 7 day trial $4.99 cheapest after References: [1]: #social-automation [2]: #zappier [3]: #automateio [4]: #form-submission [5]: https://formkeep.com/

I finally fixed my Styled-Components in gatsby.js

I finally fixed my Styled-Components in gatsby.js. I am starting a redesign of my website. I have started cross posting to dev.to [1] more regularly. With that I have been making more detailed cover images at the recommended 1000x420. These images get cut off on my own site, which is a bit ridiculous to have my own content not look right on my own site. But before we start a heavy redesign I have a small issue that has plagued the site for at least a year! I have a small issue that has plagued the site for at least a year! I have been using styled components in my gatsby.js site for about a year now. And it has been plagued by styled-components not being in the ssr causing some jank in the styles being loaded. You can see it in the lighthouse performance report below. It generally loads super quick, and is only caused on first load. Anything using the gatsby <Link/> component typically is fine and unaffected by the issue. The fix # [2] The fix was so simple it was only 2 lines t...

Should I switch to Zeit Now

Netlify # [1] I have happily had my personal site waylonwalker.com [2] hosted on netlify for nearly 2 years now. In fact I have hosted about a dozen different toy projects to play with on there, 4 of which have gone far enough to get a custom domain name. They are fast to deploy and consistently do so on every git push to main. Zeit # [3] I have recently started playing with zeit again. I really like their cli tool, its dead simple and makes sense. I tried the netlify one early on and dont think I really gave it much of a chance. I was able to backup a site we were modifying by saving everything locally (literally control+s) and running now in the command line. While I was on the site I realized that when switching to gatsby v2 I had deployed it to now.sh while testing, before cutting over to the updated one on netlify. It has been building every version since without issue! It has been building every version since without issue! What I am using # [4] - gatsby - forestry.io ...

git push without setting upstream

Finally after years of hand typing out a full git push --upstream my_really_long_and_descriptive_branch_name I found there is a setting to automatcally push to the current branch. More realisitically I just did a git push let git [1] yell at me, and copying the suggestion. git config # [2] git config --global push.default current This one setting will now git push to the current branch without yelling at you that your upstream does not match your current branch. This helps me ship chnages faster as I am constantly chnaging projects and branches. References: [1]: /glossary/git/ [2]: #git-config
1 min read

Out of Space

This morning I logged into my machine and was nearly out of space - 64GB miniconda3! - 5GB conda cache - 4GM pip cache - 34GB docker Find it # [1] [2] These are the commands that I often use to reclaim space. Its so easy to fill up small vm’s in the cloud, or in my case today let your dev machine go way too long without a good cleanup. Show Remaining Space on Drives # [3] This shows us where to start and gives a baseline of how much space we have reclaimed. df -h show largest files in current directory # [4] Next keep drilling into directories that are big and running this command to see whats big inside of it. When you find somethign that you are willing to part with rm -rf <directory> it and check df -h to see if you have enough reclaimed yet. du . -h --max-depth=1 Honestly I rarely bother unless the directory is in the GB’s of space. A super simple filter for that is to just grep for G. du . -h --max-depth=1 | grep G conda # [5] How Many? # [6] As a first baseline...
2 min read

simple click

cli tools are super handy and easy to add to your python libraries to supercharge them. Even if your library is not a cli tool there are a number of things that a cli can do to your library. Example Ideas # [1] Things a cli can do to enhance your library. πŸ†š print version πŸ•Ά print readme πŸ“ print changelog πŸ“ƒ print config ✏ change config πŸ‘©β€πŸŽ“ run a tutorial πŸ— scaffold a project with cookiecutter πŸ–± Click [2] # [3] Click [2] is the most popular python cli tool framework for python. There are others, some old, some new comers that make take the crown. For now Click [2] is the gold standard if you want to make a powerful cli quickly. If you are dependency conscious and dont need a lot of tooling, use argparse [4]. Project Structure # [5] . β”œβ”€β”€ setup.py └── simple_click β”œβ”€β”€ cli.py └── __init__.py ❯ cli.py # [6] # simple_click/cli.py import click __version__ = "1.0.0" @click.group() def cli(): pass @cli.command() def version(): """prints project version""" click.echo(__...

Personal URL shortener with Netlify Redirects

I love using URL shorteners to easily share links without hitting character limits, but they loose their meaning. Services like bit.ly will save my links for me so that I can find them, but I would rather them to be easy to remember. https://bit.ly/2ruLwQz does not roll of the tongue so well. 301 πŸ€Έβ€β™€οΈ # [1] I recently discovered a really cool feature of netlify that I have always looked past, _redirects. It is so simple cool and powerful, every netlify site should do this! But how πŸ€·β€β™€οΈ # [2] simply add a _redirects file to the root of your your published site with the following format. The trick I found with my gatsby site was that it needed to be in my static directory /static/_redirects, not root. Next you just put space separated links on separate lines. #’s can be used for comments. # netlify redirects # from_url to_url # Short-Blog /blog/scli /blog/simple-click/ /blog/cmdt /blog/cmd-exe-tips/ . . . # splats /b* /blog/:splat /n* /notes/:splat # External /twitter https...

cmd.exe tips

I spend a lot of my time at the terminal for my daily work, mostly in Linux or wsl. One big reason for using wsl over cmd.exe is the ease of walking through history that fzf provides. This week we had a windows bug in a cli and I was stuck in vanilla cmd.exe 😭 > Cmder # [1] [2] First off if you are stuck using cmd.exe, do yourself a favor and get cmder. It makes life just a bit easier. It is super confugurable and comes with several power ups that make it a bit more enjoyable than cmd.exe. History # [3] F7 - Scroll through history F8 - Search history based Example # [4] [5] .bat # [6] The next simple technique is to save your commands into a .bat file. Any valid command ran with cmd.exe can be saved into a bat file and called again later by running it in the terminal. save your command use f7/f8 to get your command back add > filename.bat at the end, hit the home key and add echo to the front. Do not wrap with quotes. This is not bash. echo python cmd_example.py > cmd...
2 min read

What is something you should have learned or understood earlier?

Mine is the python debugger. I was a long holdout thinking that print statements were sufficient. That was untill I started having errors crop up in functions that took minutes to run. The thing that I most notably wish I would have known about is post_mortem. Example # [1] [ins] In [4]: def repeater(msg, repeats=1): ...: "repeats messages {repeats} number of times" ...: print(f'{msg}\n' * repeats) [ins] In [5]: repeater('hi', 3) hi hi hi [ins] In [6]: repeater('hi', 'a') --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-0ec595774c81> in <module> ----> 1 repeater('hi', 'a') <ipython-input-4-530890de75cd> in repeater(msg, repeats) 1 def repeater(msg, repeats=1): 2 "repeats messages {repeats} number of times" ----> 3 print(f'{msg}\n' * repeats) 4 Debug with iPython/Jupyter %debug Vanilla Debug # [2] import pdb import sys pdb.post_mortem(sys.last_traceback) More # [3] For more inform...
1 min read

Supercharge Zsh Startup

I have been using oh-my-zsh successfully for about 2 years now. But lately my startup time has been really bothersome. It has grown to the point where it was taking about 5.5s to startup a shell! This is ok if I am going to spend some time in here for awhile and do some work that benefits from all of the autocompletions, plugins, and shortcuts that oh-my-zsh brings. But to only jump in to run a handful of commands is infuriating. πŸ“‘ My Setup # [1] I believe the real issue is io speed on wsl. I have some remote servers with similar configs that are 10x faster or more, loading in 100s of milliseconds rather than seconds. Sourcing all of the individual plugin files are just too much for it. πŸ’¨ How Fast can it be # [2] Quick side note: your zsh config is controled by your ~/.zshrc file. This file can source other files, load plugins, or run literally anything. Time the initial time time zsh -c exit Move your ~/.zshrc config file. mv ~/.zshrc ~/.zshrc-back Time the fastest startup p...

Keep Location List Closed

Vim’s (neovim in my case) location list can provide some very useful information while developing. Mine gives me information about linting and type checking errors with fairly little config. Generally, it sits nicely at the bottom of the screen and barely affects me. Other times, especially while zoomed way in during a presentation, it just gets in the way. [1] Location List eating up the screen while I am zoomed in and trying to live code Toggling the location list # [2] Through some google search I found the culprit was syntastic. It has an auto_loc_list feature. We can turn it off by setting syntastic_auto_loc_list=0. let syntastic_auto_loc_list=0 Keybindings # [3] I want to keep the location list open automatically most of the time, but when I don’t want it to keep opening it’s generally detrimental. Trying to live code while the location list keeps taking up the whole screen is not cool. First, create a function that will toggle both the location list and syntactic toget...
1 min read

SqlAlchemy Models

Make a connection # [1] from sqlalchemy import create_engine def get_engine(): return create_engine("sqlite:///mode_examples.sqlite") Make a session # [2] from sqlalchemy.orm import sessionmaker def get_session(): con = get_engine() Base.bind = con Base.metadata.create_all() Session = sessionmaker(bind=con) session = Session() return session Make a Base Class # [3] from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() Base.metadata.bind = get_engine() Make your First Model # [4] class User(Base): __tablename__ = "users" username = Column('username', Text()) firstname = Column('firstname', Text()) lastname = Column('lastname', Text()) Make your own Base Class to inherit From # [5] class MyBaseHelper: def to_dict(self): return {k: v for k, v in self.__dict__.items() if k[0] != "_"} def update(self, **attrs): for key, value in attrs.items(): if hasattr(self, key): setattr(self, key, value) Use the Custom Base Class # [6] class User(Ba...
1 min read

Building Cli apps in Python

Packages # [1] Click [2] # [3] Inputs # [4] Click primarily takes two forms of inputs Options and arguments. I think of options as keyword argument and arguments as regular positional arguments. Option # [5] - typically aliased with a shorthand (’-v’, β€˜β€“verbose’) --- **From the Docs [6] To get the Python argument name, the chosen name is converted to lower case, up to two dashes are removed as the prefix, and other dashes are converted to underscores. @click.command() @click.option('-s', '--string-to-echo') def echo(string_to_echo): click.echo(string_to_echo) @click.command() @click.option('-s', '--string-to-echo', 'string') def echo(string): click.echo(string) --- Argument # [7] - positional - required - no help text supplied by click Yaspin [8] # [9] [10] Click Help Colors [11] # [12] [13] # [14] Colorama [15] # [16] Colorama Example [17] Click DidYouMean [18] # [19] References: [1]: #packages [2]: https://click.palletsprojects.com/en/7.x/ [3]: #clickhttp...
1 min read

Kedro

See all of my kedro related posts in [[ tag/kedro ]]. #kedrotips [1] # [2] I am tweeting out most of these snippets as I add them, you can find them all here #kedrotips [3]. πŸ—£ Heads up # [4] Below are some quick snippets/notes for when using kedro to build data pipelines. So far I am just compiling snippets. Eventually I will create several posts on kedro. These are mostly things that I use In my everyday with kedro. Some are a bit more essoteric. Some are helpful when writing production code, some are useful more usefule for exploration. πŸ“š Catalog # [5] [6] Photo by jesse orrico on Unsplash CSVLocalDataSet # [7] python import pandas as pd iris = pd.read_csv('https://raw.githubusercontent.com/kedro-org/kedro/d3218bd89ce8d1148b1f79dfe589065f47037be6/kedro/template/%7B%7B%20cookiecutter.repo_name%20%7D%7D/data/01_raw/iris.csv') data_set = CSVLocalDataSet(filepath="test.csv", load_args=None, save_args={"index": False}) iris_data_set.save(iris) reloaded_iris = iris_data_se...

πŸ“ Packages to Investigate Notes

- jmespath - Tabnine Bulwark # [1] |-|-| |github: |https://github.com/zaxr/bulwark| I definitely want to try this out with kedro. Bulwark is a package for convenient property-based testing of pandas dataframes, supported for Python 3.5+. Example # [2] import bulwark.decorators as dc @dc.IsShape((-1, 10)) @dc.IsMonotonic(strict=True) @dc.HasNoNans() def compute(df): # complex operations to determine result ... return result_df References: [1]: #bulwark [2]: #example
1 min read

Just Use Pathlib

Pathlib is an amazing cross-platform path tool. Import # [1] from pathlib import Path Create path object # [2] Current Directory cwd = Path('.').absolute() Users Home Directory home = Path.home() module directory module_path = Path(__file__) Others Let’s create a path relative to our current module. data_path = Path(__file__) / 'data' Check if files exist # [3] Make Directories # [4] data_path.mkdir(parents=True, exists_ok=True) rename files # [5] Path(data_path /'example.csv').rename('real.csv') List files # [6] Glob Files # [7] data_path.glob('*.csv') recursively data_path.rglob('*.csv') Write # [8] Path(data_path / 'meta.txt').write_text(f'created on {datetime.datetime.today()}) References: [1]: #import [2]: #create-path-object [3]: #check-if-files-exist [4]: #make-directories [5]: #rename-files [6]: #list-files [7]: #glob-files [8]: #write
1 min read

Custom Python Exceptions

Custom Exceptions # [1] class ProjectNameError(NameError): pass class UserNameError(NameError): pass class CondaEnvironmentError(RuntimeError): pass class BucketNotDefinedError(NameError): pass References: [1]: #custom-exceptions
1 min read

Filtering Pandas

query # [1] Good for method chaining, i.e. adding more methods or filters without assigning a new variable. # is skus.query('AVAILABILITY == " AVAILABLE"') # is not skus.query('AVAILABILITY != " AVAILABLE"') masking # [2] general purpose, this is probably the most common method you see in training/examples # is skus[skus['AVAILABILITY'] == 'AVAILABLE'] # is not skus[~skus['AVAILABILITY'] == 'AVAILABLE'] isin # [3] capable of including multiple strings to include # is in df[df.AVAILABILITY.isin(['AVAILABLE', 'AVL'])] # is not in df[~df.AVAILABILITY.isin(['AVAILABLE', 'AVL'])] contains # [4] Good For partial matches # contains df[df.AVAILABILITY.str.contains('AVA')] # not contains df[~df.AVAILABILITY.str.contains('AVA')] MASKS # [5] anything that we put inside of square brackets can be set as a variable then passed in. service_mask = skus['AVAILABILITY'] == 'AVAILABLE' name_mask = skus['NAME'] == 'Dell chromebook 11' Operators # [6] & - and ~ - not | - or AVAILABLE and ...