Published

All published posts

2457 posts latest post 2026-04-19
Publishing rhythm
Apr 2026 | 40 posts

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.

[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...

...

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.

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.

Quick side note: your zsh config is controled by your ~/.zshrc file. This file can source other files, load plugins, or run literally anything.

...

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.

Location List eating up the screen while I am zoomed in and trying to live code

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.

...

1 min read

SqlAlchemy Models

Make a connection # from sqlalchemy import create_engine def get_engine(): return create_engine(&#34;sqlite:///mode_examples.sqlite&#34;) Make a session # 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 # from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() Base.metadata.bind = get_engine() Make your First Model # class User(Base): __tablename__ = &#34;users&#34; username = Column('username', Text()) firstname = Column('firstname', Text()) lastname = Column('lastname', Text()) Make your own Base Class to inherit From # class MyBaseHelper: def to_dict(self): return {k: v for k, v in self.__dict__.items() if k[0] != &#34;_&#34;} def update(self, **attrs): for key, value in attrs.items(): if hasattr(self, key): setattr(self, key, value) Use the Custom Base Class # class User(Base, MyBaseHelper):...
1 min read

I came across blocks from blocks, and it’s packed with great features and ideas.

A JSX-based page builder for creating beautiful websites without writing code

Building Cli apps in Python

Click primarily takes two forms of inputs Options and arguments. I think of options as keyword argument and arguments as regular positional arguments.

**From the Docs

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.

...

1 min read

Kedro

See all of my kedro related posts in [[ tag/kedro ]].

I am tweeting out most of these snippets as I add them, you can find them all here #kedrotips.

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.

...