Skip to content

works on my machine

¯\_(ツ)_/¯

  • Projects
  • Prototypes
  • Coding
  • HowTos
  • Pinouts
  • Story time

Links

Github
  • About
works on my machine
¯\_(ツ)_/¯

Coding

Some useful and / or yummy code to remind my brain what I already forgot (again) – and for your amusement.

  • Which kettlebells to buy? Possible unique combination sums of int values in Python
    Coding

    Which kettlebells to buy? Possible unique combination sums of int values in Python

    ByStefan July 25, 2025July 25, 2025

    It is prime day and you are wondering which kettlebells to buy? What are the possible weight combinations of all different weights including using between one and all of them with a dip belt? Yeah that’s really the motivation of how this started 🙂 What became of if was a method taking multiple int values,…

    Read More Which kettlebells to buy? Possible unique combination sums of int values in PythonContinue

  • Not in the dark any more – Scan Wifis with micropython on an ESP8266
    Coding

    Not in the dark any more – Scan Wifis with micropython on an ESP8266

    ByStefan July 19, 2025

    A small script to scan the neighbouring Wifis with your microcontroller. You get the following information about them: Kept the code as simple and small as possible. Available functions in network package could vary depending on used microcontroller type and micropython version / implementation. Resource links:

    Read More Not in the dark any more – Scan Wifis with micropython on an ESP8266Continue

  • I am a bit wiser or – how to combine dictionaries and see what changed
    Coding

    I am a bit wiser or – how to combine dictionaries and see what changed

    ByStefan December 9, 2024

    I currently had the problem of handling updates with partial settings of RGB lights through MQTT and HomeAssistant. As The setting has to be complete at all times in the running system, so my first solution were multiple if else clauses and changed flags. It works, but it is ugly and over-complicated. I didn’t use…

    Read More I am a bit wiser or – how to combine dictionaries and see what changedContinue

  • Juggling with (your) balls – Quick sort in Python
    Coding

    Juggling with (your) balls – Quick sort in Python

    ByStefan September 17, 2024November 21, 2024

    A milltion times already on the internet and sorting methods already integrated in the language – so why?Because written things stay better in the brain and I like to understand things from the ground. ArjanCodes (I love your content!) recently posted a video about recursive functions and used a similar code. I won’t have written…

    Read More Juggling with (your) balls – Quick sort in PythonContinue

  • Is it a bird? Is it a plane? Nah – just a Python class behaving like a dictionary.
    Coding | HowTos

    Is it a bird? Is it a plane? Nah – just a Python class behaving like a dictionary.

    ByStefan April 9, 2024April 10, 2024

    For a container class with a dictionary with config values (among other members) I wanted easy reading access as if it was a dict itself. For that you only have to implement the __getitem__ method. You can extend the provided dict functionality for your class if needed like the following: All but the update method…

    Read More Is it a bird? Is it a plane? Nah – just a Python class behaving like a dictionary.Continue

  • Conan smash mirrors! – Remove duplicates in a Python list
    Coding | HowTos

    Conan smash mirrors! – Remove duplicates in a Python list

    ByStefan March 31, 2024April 3, 2024

    As most of the time – there are multiple valid ways of doing it. Keeping the order I prefer easy and readable, if it is not crucial for performance to go another way.Create a new list and add only values to it that are not already included. You can do this with a simple list…

    Read More Conan smash mirrors! – Remove duplicates in a Python listContinue

  • I am here. Definitively NOT sleeping or sunbathing – A configurable anti-AFK Python script with pyautogui
    Coding

    I am here. Definitively NOT sleeping or sunbathing – A configurable anti-AFK Python script with pyautogui

    ByStefan March 28, 2024

    Yeah I know it’s kinda pointless. I was thinking the same thing when I doomscrolled youtube shorts watching a so called programmer “Herr Programmierer” showing a simple script moving the mouse in a fixed interval to coordinates in a fixed square. I was bored, I like Python and sure I could create a better pointless…

    Read More I am here. Definitively NOT sleeping or sunbathing – A configurable anti-AFK Python script with pyautoguiContinue

  • Finding Nemo or check a Python list if there is one or all elements matching a condition
    Coding | HowTos

    Finding Nemo or check a Python list if there is one or all elements matching a condition

    ByStefan March 26, 2024

    Yeah we all can loop, but can you any or all? Checking if condition matches for at least one element of an iterable (e.g. list, tuple, set) In Python you can write that nicer with the builtin method any(): But who doesn’t like a one-liner (that is understandable): Very similar is the case if you…

    Read More Finding Nemo or check a Python list if there is one or all elements matching a conditionContinue

  • Always look on the bright side of life: An adaptive night light for RGB LED stripes in MicroPython
    Coding | Prototypes

    Always look on the bright side of life: An adaptive night light for RGB LED stripes in MicroPython

    ByStefan December 22, 2023December 22, 2023

    This covers a very configurable and more complex variant of measuring brightness and turning on LEDs.If you are looking for a more basic variant: It all began with a LDR and curiosity. The result is a night light for a ESP8266 like D1 Mini or Raspberry Pi Pico (W) which compensates darkness with many configurable…

    Read More Always look on the bright side of life: An adaptive night light for RGB LED stripes in MicroPythonContinue

  • How not to make your config file a pain in the ass – MicroPython edition
    Coding

    How not to make your config file a pain in the ass – MicroPython edition

    ByStefan December 20, 2023December 21, 2023

    Externalizing the configuration is a good idea. This makes the reusability of your program much higher and a user doesn’t have (and shouldn’t have to) change values in the code.This separation tends to show where your code is perhaps too tightly coupled and constants are referenced directly as they are directly available in the script…

    Read More How not to make your config file a pain in the ass – MicroPython editionContinue

  • Faster than the shadow – an adapting nightlight in MicroPython
    Coding | Prototypes

    Faster than the shadow – an adapting nightlight in MicroPython

    ByStefan December 18, 2023

    This is a continuation of Is it dark yet ? – Measuring brightness with LDR on Pi Pico (W) and ESP8266 (D1 Mini & NodeMCU v3) in MicroPython, but concentrating on a fast and clean code rather than how to use a LDR with MicroControllers in principle. What you need: D1 mini or a similar…

    Read More Faster than the shadow – an adapting nightlight in MicroPythonContinue

  • Trust is good control is better – JUnit Tests (parametrized and different arguments providers) with RxJava and some Mockito
    Coding

    Trust is good control is better – JUnit Tests (parametrized and different arguments providers) with RxJava and some Mockito

    ByStefan June 8, 2023

    A follow up to Software tests – some basic JUnit testing in the area of RxJava. Not much text right now, just the announcement, the code below and the link to my github repo. Includes a build.gradle with all the needed dependencies.(There are already some other test concerning ConnectableObservables subscriptions and time of emit.) Short…

    Read More Trust is good control is better – JUnit Tests (parametrized and different arguments providers) with RxJava and some MockitoContinue

Page navigation

1 2 Next PageNext

© 2025 works on my machine

Privacy Policy

Scroll to top
  • Projects
  • Prototypes
  • Coding
  • HowTos
  • Pinouts
  • Story time
Search