Weekly routine changes

I recently made four weekly routine changes all at the same time. This is rare for me - the last comparable change I made would be in June 2019 when I decided (and started) to lift consistently three days a week.

  • Three weeks ago I started swiming in the sea at 6pm on workout days;
  • A week ago I moved my 3x weekly weightlifting from 7pm to 5:30am;
  • I stopped drinking coffee (usually 2 cups over the course of a ☞

How to Refactor Code

Seems obvious, right? You just edit it until it works the way you want it to. Not so fast. Reckless code changes will turn your project into a big ball of mud before you know it. Done in the right way you'll experience less frustration and fewer crises.

While you may write code as a developer, your main task is not writing code: it's removing ambiguity and mitigating project risks.

If you're working on a personal project or in a ☞

A Gherkin styleguide

Few, if any websites make useful recommendations about how to phrase Gherkin steps, so allow me to make some suggestions in the hope they will make life simpler.

Given steps establish state

Given steps describe a current, present, extant state of the test environment (I use the term loosely) before some (to be tested) action is performed.

The fact that your Given step definition likely creates that state in code behind the scenes is irrelevant.

  • Given steps must be in ☞

The ultimate AeroPress technique


Having made countless cups of AeroPress'd coffee (mostly at work), I've finally arrived at the perfect cuppa.

  1. Boil the jug. Yup, boil. You'll see why in a moment.
  2. Pour boiling water into your coffee cup. If you take milk in your coffee leave room for milk. Otherwise fill it up.
  3. Grind coffee / put ground coffee in an inverted AeroPress.
  4. Fill AeroPress with hot water from cup. Your cup is now hot and the water has cooled to the perfect temperature ☞

New project: CourseMonger.com

So! I have a new project underway, CourseMonger.com.

Unlike many solutions, this one started with a problem. My partner teaches parenting courses, each comprised of multiple workshops. Each workshop can be at a different price and vary in number of places available. Any prospective system would also need to provide a reservation system whereby a place is reserved for say, 8 minutes while a student completes her booking.

Eventbrite provides registration-locking, but the Eventbrite model is based on events ☞

How to create many-to-many relationships with associated properties in SQLAlchemy

I once had a scenario where one business could be managed by multiple users, and each user could manage multiple businesses. To further complicate matters, only one user could be the Administrator of a business, which should ideally also be represented by the relationship.

Finding out how to represent that relationship was tricky as I couldn't find it in the SQLAlchemy docs, and StackOverflow was a mixed bag. This is what I pieced together:

from datetime import datetime as dt ☞

Page 1 / 2 »