Developing with SSL

    Web development is something I do infrequently (it doesn’t feature in my day job), meaning some industry trends tend to pass me by. The restriction that some JavaScript client APIs are only available over HTTPS1 is one such trend I had missed.

    Encountering this restriction, I had assumed that it would be extremely difficult to set up HTTPS server locally for development. It turns out, however, it’s very easy using Flask (my go-to lightweight Python server of choice): simply passing ssl_context='adhoc' to the run method will dynamically generate, and use, an ad-hoc SSL certificate.

    if __name__ == '__main__':
        app.run(host='0.0.0.0', ssl_context='adhoc', port=4443)
    

    1. For example, iOS requires this for accessing the accelerometer using device motion in Mobile Safari. Something I’ve been experimenting with for my 360° photo viewer. 

    Things I Have Done During Quarantine

    Here in the San Francisco Bay Area, we’ve been ‘sheltering in place’ for over two months. I feel incredibly fortunate that–as of now 🤞🏻–I only know a very few people who have had COVID-19, but it’s still been a challenging time: focusing on the things that bring joy, like long-term projects, and writing up those projects, has been hard.

    Given that, I thought I’d embrace short-form and list some of the things I’ve done during quarantine. This is intended both to serve as a reminder that I’m getting things done in these strange times, and to let me pause and smile at the absurdity of some of them.

    • Played Minecraft for the first time ever.
    • Purchased a new vacuum cleaner (an unexpectedly exciting life experience).
    • Purchased a vacuum cleaner stand (it’s amazing they make these).
    • Built and shipped three eInk calendars to friends.
    • Finally acquired an Analogue Mega SG JPN (I’ve been coveting Analogue’s hardware ever since the Nt).
    • Bought one two three over-priced Sega Genesis games on eBay.
    • Discovered that 90s games don’t age well (Phantasy Star III is a very dull game).
    • Set up a home office. Multiple times.
    • Bought house shoes (slippers just don’t cut it anymore).
    • Assembled a hammock.
    • Set up a page to track the things I’ve done, during quarantine.
    • Updated my website builder to let me store it in iCloud and edit on my iPad Pro (my MacBook Pro now builds my website whenever the content in iCloud changes, and serves a local copy).
    • Wrestled with the macOS firewall.
    • Updated macOS. Far. Too. Many. Times.
    • Switched to Zsh.
    • Drawn a number of custom emoji.
    • Worn onesies for work on multiple days.
    • Bought a soundbar (disappointingly the Sonos Beam doesn’t sound as good as the HomePod, but it’s simple, reliable, and works with the PS4 and Mega SG).
    • Set up dynamic DNS for my laptop, and our apartment.
    • Helped my father set up a Planet Computers Cosmo Cosmo (it’s great to see the Psion Series 5 keyboard on a modern device; it’s disappointing that device runs Android).
    • Watched an unhealthy number Twitch and YouTube streams.
    • Sold a number of things on eBay.
    • Bought a Psion Travel Modem (with a view to turning it into a Psion WiFi adapter).
    • Baked no-knead bread (like, it would seem, most of the Western world).
    • Bought far too many tissue box covers (apparently the smallest of things can become frustrating if you spend too much time staring at them, including the terrible designs on most tissue boxes).
    • Learned about the DOMs MutationObserver (and used it in this site).
    • Published some of my photos from Burning Man.
    • Learned how to use CSS variables (and got carried away tweaking the design of this website).
    • Listened to a lot of Freddie Mercury.
    • Built another iPhone charger for a friend (that brings me to a total total of 4 already).
    • Purchased a new dustbin (not quite as exciting as the vacuum cleaner, but close).
    • Assembled an Adafruit IoT Pi Printer to print slips indicating when mail and packages can be released from quarantine.
    • Painted the walls (Sarah has pointed out that I am literally watching paint dry).
    • Learned out to use UICollectionViewDiffableDataSource.

    Unlike most of my posts, I plan to update this over time. If you’re interested in something a little more realtime, you can follow me on Twitter.

    Anzac Biscuits

    When I was growing up, visiting our family friends in the Lake District was a highlight of the year. As were the flapjacks they made–treats that brought me comfort all the way through to my time at university, when an occasional care package would bring a taste of home.

    Having craved these for many years, I finally reached out for the recipe so I could make my own. It turns out they’re actually ‘Anzac1 biscuits’, and very easy to make.

    Ingredients

    • Plain flour, sieved – 115g (4oz)
    • Caster sugar – 115g (4oz)
    • Rolled oats – 80g (3oz)
    • Desiccated coconut – 80g (3oz)
    • Butter – 115g (4oz)
    • Golden syrup – 2 tablespoons
    • Baking soda – 1 teaspoon
    • Water – 2 tablespoons

    Method

    1. Mix the plain flour, caster sugar, rolled oats, and desiccated coconut in a bowl.
    2. Melt the butter, and golden syrup in a saucepan.
    3. Bring the water to boil, dissolve in the baking soda, and then combine with the butter and golden syrup mix.
    4. Mix the melted and dry ingredients together, ensuring a consistent texture throughout.
    5. Spread the mixture on a baking tray, to a thickness of about 1 cm (3/8 inch).
    6. Bake in a regular oven at 180ºC (356ºF), or a fan oven at 160ºC (320ºF) for 20-25 minutes, or until the biscuits are a golden colour.
    7. Leave to cool before cutting into squares.


    1. Australia and New Zealand Army Corps. (I had to look that up.)