Getting Started with the Advent of Code as a #SQLNewBlogger

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

If you want to get started blogging, or revitalize your work, here is a good way to practice some T-SQL, have some fun, and build a blog.

This is a simple set of steps, but all of these will help you in the future as you expand your skills and blogging.

Online Accounts

First, create a blog. Go to WordPress and create an account for free.

Get a GitHub account. No reason to not have one these days, and it’s free. I won’t walk you through this part, but sign up.

Next, create a repository. In the repositories section, click “New” in the upper right. You can see my AdventofCode repository is already created. Make your own in your account.

2021-12-03 10_59_27-Your Repositories — Mozilla Firefox

Next, go to the Advent of Code site and log in with Github. It’s one of the auth settings. Don’t worry if you aren’t doing this in time with others. I’ve worked on this throughout the year. You can also go through previous years if you choose.

The Workstation Setup

First, install Git. This is easy and free as well. Once you have, open a command prompt. Pick a place where you want to store code and create a “git” folder. Change to this folder.

2021-12-03 11_03_37-cmd

In your Advent of Code repository, click the “Code” button in the upper right. This will open a drop down. Copy the https URL shown in there. You can see mine highlighted below.

2021-12-03 11_01_48-way0utwest_AdventofCode_ puzzles — Mozilla Firefox

In your command prompt, type “git clone “ (space here), then paste in your repo path and hit Enter. It should look something like this:

2021-12-03 11_04_19-cmd

This has downloaded the repo to this folder and linked it with my GitHub repo. This will be empty for you, but here’s what I’d suggest. Create a “2021” folder and then start putting code in there. You can see I have a few folders listed below.

2021-12-03 11_06_15-cmd

Inside the 2021 folder, I tend to separate out days. For me, I do this because I save the input files as input.txt. You can organize your code any way you want, but write about how and why. Here’s my folder.

2021-12-03 11_06_32-cmd

I have solved problems multiple ways in the past. Here’s last year’s Day 1, solved in T-SQL, Python, and PowerShell.

2021-12-03 11_07_58-cmd

Now write code and solve the puzzles.

Saving Code

You should learn git, but here is the easy way to do things. As you write code, run a “git status” in your repo (any folder). You’ll either see everything is clean and up to date, or something like this:

2021-12-03 11_10_08-cmd

When you want to save something, type “git add –all”. This adds all files to the staging area. There isn’t a return here, but if you run status, you’ll see things are staged.

2021-12-03 11_11_02-cmd

Now commit a version with this:

git commit –m “xxxx”

Replace XXX with some comment. For me, I often will say which days I’ve solved. In this case, I haven’t solved day 4 yet, but I just added a note.

2021-12-03 11_11_54-cmd

Now type “git push” to send your code to GitHub. You’ll get something like this.

2021-12-03 11_12_35-cmd

That’s it.

Now you’ve learned how to move code around and source control it, you have puzzles to play with, and you can blog about how to approach problems, and how you are saving code. In fact, rewrite this post as you set up your own environment.


Here’s a great way to showcase knowledge and improve skills. This post took me about 15 minutes to setup and outside of creating accounts or installing git, I bet you could do it in the same time.

Give it a try. Start your blog today.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , , . Bookmark the permalink.