Sblog

Vim - because fast is fun

Date: 2024-02-14

What makes fast editing fun

Improving at anything can be fun, but improving at something that you do every day feels even more satisfying because you get to apply it all the time. I've always loved watching videos of experts doing their craft so trying to get better at the most basic thing I do every day seems to follow logically.

After learning a better way to do something, doing it the old way feels slow and boring. When I think about the days when I was using the arrow keys I imagine m...

Rust workspaces

Date: 2023-01-15

I've recently come to try out workspaces in Rust and I love them. Rust workspaces are groups of crates that work together. Here are some selling points:

Easy to set up

Setting up couldn't be simpler - all you need is a single Cargo.toml file with a single section that defines what crates you have in the workspace. Example:

[workspace]
members = ["api", "core", "cli"]

Common lock file

All of your crates within the workspace have a common Cargo.lock that lives in the ma...

AoC 2022 - Days 3 to 10

Date: 2022-12-10

Day 3

Description: https://adventofcode.com/2022/day/3
Solution: https://github.com/stygian91/advent-of-code-2022/tree/master/rs/q_3

Day 3 was not very exciting - the exercise consisted of some basic string manipulation.

Day 4

Description: https://adventofcode.com/2022/day/4
Solution: [https://github.com/stygian91/advent-of-cod...

AoC 2022 - Day 2

Date: 2022-12-02

I've created a new repo for the AoC 2022 here https://github.com/stygian91/advent-of-code-2022/tree/master/

Today's exercise was pretty easy again (you can find it here). The most fun part was modelling the problem with Rust's nice enums and match statements. I made a utility method that gives you the corresponding hand based on the player's hand and the desired result. I used this to f...

Advent of Code 2022 - Day 1

Date: 2022-12-01

Advent of code 2022 has started.

The first day's task is certainly easy, as expected. You can find the exercise description here: https://adventofcode.com/2022/day/1.

I'm using advent of code as an exercise to get more familiar with Rust. I am going to be using .unwrap() here as I don't feel like proper error handling is needed in the context of these exercises.

I feel like this solution is simple enough that understanding the code should be easy...

Sblog and CSP

Date: 2022-11-19

Content Security Policy (CSP) is a great option that more people should look into enabling for their websites. Here are my experiences with it on this blog.

Although CSP is not a replacement for proper security because it relies on the browser to respect the policy. It can still help you locate problem points and should be enabled early in development.

I first enabled just the default-src 'self'; directive and soon realized that it...

Hello blog

Date: 2022-11-17

The most basic blog has started. Here are some not very well organized thoughts on what's happened so far.

Webdock

Webdock's cheapest plan makes this side project blog idea's monetary investment cheaper than the price of a meal, once per month. Their server setup couldn't be simpler and painless - the typical web stack was pre installed, which meant I could just set up the site with a little bit of Nginx config changes and some directory permission changes (admittedly those were not rea...