• Jun 16, 2025

    Making a none IOT Washing Machine and Tumble Dryer semi smart

    The situation:

    I have a Washing machine and Tumble dryer, and I need to know when they have finished washing / drying so I can get on with more fun laundry. The problem is they are in an out-building, and the built in beeping cannot be heard in the house.

    They are also the kind of appliance which weighs the contents, detects moisture levels etc and dynamically adjust the amount of time they need to run. So when I set them running and set a timer for when they are due to be finished, they will either have finished 20 minute before or still have 20 minutes left to run.

    More ...
  • May 28, 2025

    test

    test

  • May 23, 2025

    Frontend testing (Vue3)

    When testing UI components, it is important to treat them as black boxes, the same way we would test classes in an API, testing only inputs and outputs, not the internal workings.

    This means we do not test:

    • html classes
    • html ids
    • methods

    Things we can test:

    • What the component emits as a result of user interactions/child component emits
    • What the component displays, as a result of changing props, events emitted from children, and user interaction

    How we can test:

    More ...
  • Feb 28, 2025

    Typescript via jsdocs

    Generic Classes

    To create a generic class we can use the @template tag above the class, and reuse the template name in the class methods and properties:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    
    /**
     * @template T
     */
    class MyClass {
        /** @type {t} */
        #prop;
    
        /**
         * @param {T} value
         */
        constructor(value) {
            this.#prop = value;
        }
    
        /**
         * @returns {T}
         */
        getValue() {
           return this.#prop;
        }
    }
    
    /** @type {MyClass<string>} */
    const foo = new MyClass("test");
    

    If the generic needs to extend another type we can use @template {OtherType} T.

    More ...
  • Jan 8, 2025

    Questions to ask during refinement

    There are several questions I find it useful to ask myself or the team during refinement sessions, which help me think about how features can be implemented or if there are missing requirements.

    These are:

    1. How do we explain this to a user?
      • how does the user use the feature?
      • what is the reason for the feature?
    2. How can we test this?
    3. How can we update/upgrade/version this? Preferably without a breaking change.