Archive

All published posts

Send Emails with GitHub Actions

Here is one useful thing that you can do with GitHub actions no matter what language you use, send email. You might want to know right away when your ci passes. You might want to give your team a nice pat on the back when a new release is deployed. There might be subscribers wanting to see the latest release notes in their inbox as soon as the latest version is deployed. Whatever it is, its pretty easy to do with an action right out of the actions marketplace.

Here is a silly example that sends an email to yourself anytime someone stars your repo.

1 min read

What Are GitHub Actions

GitHub actions are an amazing tool that allows us to run code based on triggers inside of our repo. Their is a large and growing community of actions inside the marketplace to use with very little effort. Best of all they are free for public repositories, and private repos have a very generous free tier.

I have been diving deep into Github actions for about a month now and they are wicked good! They allow you to run any sort of arbitrary code based on events in your repo, webhooks, or schedules. They are very reasonably priced. The interface that GitHub hs developed for them is top-notch! It’s so good I have done 90% of my editing of them right from github.com.

some interaction to your repository triggers code to run.

...

5 min read

Getting Started with GitHub Actions

Github actions are written in configuration files using the YAML syntax. YAML is a superset of JSON. Most YAML can be expressed inline with JSON syntax. Similar to python YAML is whitespace driven by whitespace rather than brackets tags. The argument for using YAML for configuration files such as actions is that it is more human-readable and editable. It’s much easier to see the whitespace layout than it is to get closing brackets correct. For actions, I believe this is mostly true. I don’t see any use case to get past 3-5 indents, which is completely manageable.

Can I just say that I learned more than I realized about YAML by writing this article

In YAML or JSON, the most basic containers for data are arrays, a 1D list of things, and objects, for key-value pairs.

...

4 min read

Today I learned `git diff feature..main`

Today I learned how to diff between two branches.

git diff feature..main

Sometimes we get a little git add . && git commit -m "WIP" happy and mistakenly commit something that we just can’t figure out. This is a good way to figure out what the heck has changed on the current branch compared to any other branch.

Let’s create a new directory, initialize git and toss some content into a readme.

...

2 min read
git

What is YOUR Advice for New Data Scientists

You dont have to start out as a git wizard with the cleanest possible commit history. At first dont let yourself get too wrapped up in it, the most important part is that you make commits. You will find needs for more advanced stuff later.

git add . git commit -m "FEAT added new function to calculate revenue by product family" git push

Get comfortable with this, then learn how to branch, rebase, stash, etc…

Get the job done. Keep it in small bite size pieces. Make readable function definitions and variable names. You will thank yourself for naming things well later. Readability counts more than performance in most cases of data science. If it gets the job done try not to over worry about things like performance. A few extra seconds to clean a dataset or build a model is not worth hours of your time. As you go you will have cases that performance is more critical and you will learn what to do from the start to avoid them.

1 min read

Do You Hoist

I am working through Wes Bos’s beginnerjavascript.com/ I just hit module 18 on hoisting. It’s something that I always knew was there, Its not something I typically see used or use myself.

Do you have any use cases that you use hoising? Why? It seems like a really cool feature in any language that uses it, but I dont really notice it in use.

There are many articles that cover this in far more depth, but its the idea that variable declarations and functions are defined before they are executed. This means that it doesnt matter if you call a function before or after it is defined.

...

2 min read

What is Kedro

What is Kedro

This is my original what-is-kedro article. There is a brand new one

Kedro is an open source data pipeline framework. It provides guardrails to set your project up right from the start without needing to know deeply how to setup your own python library for data pipelining. It includes really great ways to manipulate catalogs and pipelines. This article will cover the 10K view of kedro, future articles will dive deper into each one.

...

Custom Scrollbar Design

Getting a custom scrollbar on your site makes it stand out a bit compared to the very plain stock one that are on most sites. This is how I set mine up on my gatsby site.

Inspired by Wes Bos’s new uses.tech I wanted a custom scrollbar on my personal site. I had tried to do it in the past, but gave up after it was not working.

Since uses.tech is open source I jumped on github, searched for scroll and found this layout.js.

...

2 min read

2020 waylonwalker.com rebrand

Moving into 2020 I have been really leaning on using purple as my theme color everywhere more and more. Its time for an update to my personal site, not just because it feels plain, not just because the cover art I am using for dev.to doesn’t fit my current card layout, but because I feel inspired and I want to.

This is what we are working with. It has been my card design for at least a year now. Its not bad but, its a bit play, doesnt fit my new cover art style, and that date is not working over top of the cover art text.

I have been really into using a deep purple lately. It is a neutral color that does not get enough respect, i.e. it’s not used as frequently and kinda stands out when used.

...

4 min read

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

installation is easy

npm i react-headroom

Import Headroom #

There was no instructions for es6 style imports that are common with gatsbyjs sites like mine, but it was intuitive to figure out.

...

2 min read

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

...

Should I switch to Zeit Now

I have happily had my personal site waylonwalker.com 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.

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!

...

2 min read

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 yell at me, and copying the suggestion.

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.

1 min read

Out of Space

This morning I logged into my machine and was nearly out of space

screenshot-2025-02-12T22-32-14-298Z.png

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.

...

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.

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

...

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.

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!

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.

...

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 😭

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.

F7 - Scroll through history

...

2 min read
cli

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 iPython/Jupyter

%debug 

Vanilla Debug #

import pdb import sys pdb.post_mortem(sys.last_traceback) 

More #

For more information about the debugger checkout the real...

...

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
vim

SqlAlchemy Models

Make a connection ¶ # from sqlalchemy import create_engine def get_engine(): return create_engine("sqlite:///mode_examples.sqlite") 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__ = "users" 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] != "_"} 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): __tablename__ = "users" username = Column('username', Text()) firstname = Column('firstname', Text()) lastname = Column('lastname', Text())
1 min read