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.
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.
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.
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.
In your command prompt, type “git clone “ (space here), then paste in your repo path and hit Enter. It should look something like this:
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.
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.
I have solved problems multiple ways in the past. Here’s last year’s Day 1, solved in T-SQL, Python, and PowerShell.
Now write code and solve the puzzles.
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:
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.
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.
Now type “git push” to send your code to GitHub. You’ll get something like this.
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.