Similar artist network

Motivation If you are anything like me, you occasionally find yourself coming up for air after a long diversion clicking through artist biographies on Spotify. Often these biographies will list the artists other bands or people they have played with, and one thing leads to another and I have added twenty albums to my “new music” playlist folder. I found myself in this position one morning after listening to this episode of Casual Inference, a great podcast that has unfortunately gone radio silent of late....

August 29, 2023 · 8 min · Me

Python sucks at basic data visualization

Yes, it’s hyperbolic, but it’s not wrong I recently saw the following tweet comparing the Canadian and US housing markets. As an American Canadian permanent resident who experiences this phenomenon acutely, I was naturaly interested. What particularly got my attention was the claim in one of the comments that this was “70% Toronto and Vancouver”. I thought, “I wonder if I can verify that…”. So I went to the Statistics Canada website and found the New housing price index which has monthly data on the cost of new housing going back to 1981 for 26 cities across the country....

June 8, 2023 · 4 min · Me

git status - fatal: cannot chdir

tldr: If you make any changes to the file path of a git submodule, you need to also update all of your config files accordingly. Background I use the Papermod Hugo theme for my personal website. One of the ways to use Hugo themes is to install them as a submodule inside your project’s ./themes directory. I wanted to update the module today as there have been a number of changes since I set it up....

May 26, 2022 · 3 min · Me

Git

Pull changes in from master that have happened since making changes on feature branch git checkout feature git rebase master Merge feature branch into master To merge a feature into master, first commit changes to your feature branch, then: git checkout master git pull origin master git merge feature git push origin master See history git log to see all. Include file if you only want to see history for that file: git log [filename]

March 22, 2022 · 1 min · Me

bash

At the moment, this is just a dumping ground for useful tidbits I find / need in my daily work. At some point I will get around to organizing and formalizing. Parameter Expansion Bash reference manual Slice a string a="teleport" b=${a:4:7} echo $b > port Replace a portion of a string The pattern is ${parameter/pattern/string} to replace the first occurence of pattern with string or ${parameter//pattern/string} to replace all occurrences....

March 10, 2022 · 1 min · Me

vim

At the moment, this is just a dumping ground for useful tidbits I find / need in my daily work. At some point I will get around to organizing and formalizing. File formats (carriage returns) If you ever diff two files that look identical, but they display as completely different, you may be dealing with a file format issue. This may happen if you are sharing files between different OS. To display the file format of your current file type this:...

March 10, 2022 · 2 min · Me

awk

Basic syntax awk [ options ] script filename Where script is either a single awk command or file of awk commands. Awk commands look like this: TODO and filename can be omitted if you’re piping in standard input. Commands Options Examples Length of the longest line in a file awk '{ if (length($0) > max) max = length($0) }; END { print max }' file Selecting, filtering, and basic arithmetic Sum a field, specify delimiter awk -F '\t' '{print sum+=$1;} END {print sum}' file....

February 7, 2022 · 1 min · Me

Sed

This is an ongoing work in progress, please let me know if you have any suggestions/feedback. Basic syntax sed [ options ] script filename Where script is either a single sed command or file of sed commands (must use with -f option). Sed commands look like this: action/pattern/replacement/flag Filename can be omitted if you’re piping in standard input. Actions p: print s: substitute s accepts the following flags which are appended to the end of the command (e....

January 30, 2022 · 2 min · Me

Change git branch (master to main)

Here’s another thing I’ve googled enough times to just put it somewhere I know. First, rename your local branch: ❯ git branch -m master main Then you can check that it worked: ❯ git status On branch main Your branch is up to date with 'origin/master'. nothing to commit, working tree clean If you don’t have dependencies that might get screwed up by simply renaming your master branch, you can just navigate to your remote directory and change the name (if you use github, from the repo’s home page, click Settings > Branches and then click the edit button that looks like a little pencil)....

March 17, 2021 · 1 min · Me

Flask wordcount app

I made a simple flask app that takes a URL as input and returns a table and chart of the most used words on the site. Built with Flask using a Postgres backend. Uses beautiful soup to scrape and process html from given website. Implements a Redis task queue to handle requests. Uses Angular to poll the back end for completion and to display a word frequency chart using JavaScript and D3....

March 11, 2021 · 1 min · Me