On my mind.

  1. the musical experience which had most impact on me was one time in gothenburg, at a sleazy karaoke bar. one woman came up to the mic, and it looked like she had been through a lot in her life. i don't know, i just felt it. then she went on and did the most emotional and beautiful version of alanis morissette's "ironic".

    totally blew me away. the song was hers.

    may 3rd, 2022 — 19:37 #

    from on the run

  2. finished two shows today: Euphoria S02 and Pam & Tommy.

    Euphoria is simply amazing. i loved season one. season two is grittier, and while it uses violence, sex, and drugs to describe the world, it’s always the characters that shine through. i’ve never seen better acting than zendaya’s performance as rue.

    pam & tommy is kinda of a curve ball. i like it! i didn’t think i would. it manages to take a story (pamela anderson & tommy lee’s stolen sex tape in the 90s) and make a whole series about it. i liked the sentimental rendition of their mutual love for each other. also, the issue of men vs. women in terms of leaked nudes is also brought up. “i was in that tape too!”, says tommy. “it’s not the same! i’m.. i’m.. a woman!”, says pamela. and it’s not just hollow talk: the series actually manages to showcase how pamela suffered.

    i also appreciated the 90s LA vibe ☀️

    april 6th, 2022 — 18:07 #

    from on the run

  3. i don't think everyone need heavy test runners and framework for every project. a single file with import assert from 'assert' (node) and a bunch of assertions can suffice for a tiny prototype project.

    if you want more structure, where do you go? the npm libraries tape and tap have ~20 dependencies each. ava has ~40. i don't even want to think about jest

    i'm sure these packages are great for certain things. but here's a minimal test runner i've written:

    Johan's Test Runner →

    it works as you'd expect:

    1. create a test file.
    2. import test and write test cases.
    import { test } from "./_test-helper";
    import assert from 'assert/strict';
    
    test('it works', () => {
        assert.equal(true, true);
    });
    

    i use node's assert for assertions. want typescript support? add esbuild and esbuild-register as dev dependencies and run tests with:

    node -r esbuild-register run-tests.ts
    

    the runner supports returning promises, as well as printing fancy file names for each test case.

    i appreciate taking this approach before jumping to npm install <dep>. it gives me very much peace of mind, as long as you don't spend too much time maintaining your own tooling.

    march 16th, 2022 — 19:58 #

    from on the run

  4. my latest favourite cocktail is this gin sour with bergamot and black tea. you've probably felt the scent of bergamot in earl grey tea or in perfumes. it's a highly aromatic citrus fruit: it looks like a large, more spherical, lemon. it's also surprisingly hard to find here in stockholm – even when it's in season.

    i found this recipe (in swedish...) and got hold of a batch of bergamots through a restaurant friend. i've translated the recipe to english below:

    Gin tea sour

    Ingredients

    • 5 cl gin
    • 3 cl freshly squeezed juice from bergamot
    • 2 cl earl grey simple syrup (see below)
    • 1 egg white

    Procedure

    1. Pour gin, bergamot juice, simple syrup, and egg white in a shaker.
    2. shake like hell for a minute. it should create a lot of foam.
    3. add ice cubes to the shaker and shake until the shaker gets cold.
    4. strain into a coupe glass and decorate with something green or tea related.

    the cocktail will get a lovely orange tea-like colour too!

    Earl Grey simple syrup

    Ingredients

    • 2 dl water
    • 2 dl cane sugar
    • 1 bergamot
    • 2 strainers of black, neutral tea

    (this will make more syrup than you need for one drink.)

    Procedure

    1. combine water and sugar in a pot.
    2. add the zest of the bergamot (the outer layer of the peel, save the fruit with its juice for the drink). avoid the white layer beneath.
    3. put everything to a boil for a couple of minutes.
    4. remove from the heat, add the tea strainers with black tea.
    5. let it sit for at least 5 minutes. it should gain a strong flavour.
    6. remove the strainers and let the syrup cool.
    7. strain (to remove the bergamot zest) and pour the syrup into a small bottle and store in the fridge.

    i think the simple syrup is as best the first few days, but mine has lasted over a week now. just don't forget it in there…

    march 15th, 2022 — 10:12 #

    from my living room table in stockholm

  5. The best fruits

    1. Banana. they're full of vitamins, fibers, and natural sugars. they provide the best energy, and are easy to a) carry around, b) peel. they're perfect.
    2. Mango. whenever i get to pick flavours for (let's say) ice cream, i always pick mango (or a combo of mango + something else). they are the best tropical fruits when it comes to flavour. they're less easy to peel and deal with than a banana
    3. Clementine/Satsuma/Tangerine. easy to handle and somewhat easy to peel. the best of juices, and full of vitamins. makes the day brigher.
    4. Pear. sweeter than apples, with a soft, moist flesh full of fibres. they can be watery though, so not as rich as mangoes and bananas.

    1. Pineapple. i really hate these. ugly, hard shell, weird flavour. i would never carry these on a trip, nor try to peel them as an ingredient.

    february 17th, 2022 — 12:48 #

    from my kitchen table in stockholm

  6. i love this quote from Nils van der Poel (emphasis mine):

    I think it's important to understand that you're not doing it for a gold medal. Regardless of which life you chose to live, you will sacrifice something, that's the way it is.

    As soon as you go in one direction, you also choose to not go in all other directions at the same time. It's the basic precondition for going anywhere at all.

    But on the path you take, you will experience fantastic things, even though it's uphill there will be a great view when you're at the top, and that's what makes it worth it, to be on this journey with people you love. It doesn't matter that much where the journey ends. A movie with a sad ending is also a good movie - and a movie with a nice ending makes you happy.

    I'm very happy for this medal around my neck, and for getting all the way here. But why do you do it? I don't think you get to pick your dreams, they pick us. It's up to us to realize them or not, and it seems like people who try to realize their dreams are happier.

    Nils van der Poel is a swedish olympic speed skater who just won two gold medals in the beijing 2022 olympics.

    source: Radiosporten's Twitter (swedish). translated to english by jacobr.

    february 14th, 2022 — 10:20 #

    from my kitchen table in stockholm

  7. i'm switching to sublime text from vs code as main code editor, and man – it's much more config to do before it's usable to me. vs code follows more of a "batteries included" and "sensible defaults" approach.

    this is my behavioural config (typography stuff removed):

    {
        "create_window_at_startup": false,
        "draw_indent_guides": true,
        "enable_tab_scrolling": false,
        "ensure_newline_at_eof_on_save": true,
        "highlight_modified_tabs": true,
        "highlight_line": true,
        "remember_open_files": false,
        "translate_tabs_to_spaces": true,
        "shift_tab_unindent": true,
        "hide_new_tab_button": true,
        "caret_style": "blink",
        "caret_extra_top": 1,
        "caret_extra_bottom": 1,
        "trim_trailing_white_space_on_save": "all",
        "scroll_past_end": true,
        "mini_diff": "auto",
        "folder_exclude_patterns": [
            ".svn",
            ".git",
            ".hg",
            "CVS",
            ".Trash",
            ".Trash-*",
            "node_modules",
            "build"
        ],
    }
    

    the last one is especially interesting. as of january 2022, there's still no way to tell sublime to ignore files in .gitignore. sublime should hide/gray out the files/folders in the sidebar, and not make them appear in the quick open dialog. so i have to add folders such as node_modules and build to the global config. people tell me to use some plugin (sublime-gitignorer), but meh... this issue from 2019 is still open.

    then i couldn't get the editorconfig plugin to work. i tried changing indent_size in my .editorconfig file, but the change wasn't reflected in the editor. joy.

    then i realised that the typescript in sublime 4 isn't really "support": it's more "the syntax highlighting" is working. one has to install a typescript package for the Language Server Plugin for intellisense (completions, etc) to work. people don't like this.

    then i installed prettier along with the sublime plugin, but formatting on every save isn't viable since it's very slow. somebody online said that vs code's prettier extension is keeping long running node processes instead of spawning a single one for each save. sublime's plugin is evidently not doing that. may have to check out dprint, but that plugin isn't even out in package control yet. hehe.

    then there are these small annoyances like i can't do backspace to delete a file when it's focused in the sidebar. or hit enter to rename it. but no can do. like, what?! this is standard file explorer shortcuts? i timeboxed 5 min to find a keybinding but couldn't. i guess my mental model from atom and vs code differs from sublime's.

    i'd really like more visual cues in the sidebar file tree about modified or added files, like vs codes does. makes it a lot easier to navigate.


    so is switching worth it? sublime is so much faster than the electron based editors it's ridiculous. when i'm comparing opening this repo's folder with code . and subl . from the command line, i understand how gaslighted i've been with the electron editors. sublime just flashes and it's open while vs code is busy booting another chromium app or whatever it's doing.

    but i dislike having to carry around a set of plugins and settings when i switch computers. vs code has this nice settings sync feature built in, but i'm 100% sure i need to sort that out myself for sublime with some esoretic github gist based thing…

    maybe Jetbrains Fleet will be The One editor: native, without bloat, and configurable?

    if anybody uses any life saving plugins for sublime, please give me a shout.

    february 8th, 2022 — 08:50 #

    from on the floor in my apartment in stockholm

  8. i love creating playlists. it's like the lost art of making mixtapes for yourself of somebody else. even though Spotify (and other services surely) have invested a ton content curation, i still love my own hand made playlists. spotify, for instance, have a lot of both automated and handmade playlists for a myriad of occasions. they're kinda niche and cool, but… i still think they're a bit bland.

    what i appreciate is that it's a constant, living project. this categorisation builds up over time as i discover new material, and i'm now wired to place it in a playlist if i like the track. good for future johan and others.

    here are some of them:

    • Johan Recommends 👌. this one has been around since i got a beta invite to Spotify. i dunno, perhaps 2008? the listing doesn't tell the date of the two earliest tracks added (just a blank column). this playlist is just a dump of what i'm listening to at the moment. it forms a nice history of what i liked over the years.
    • ☕ Programming. music i code to. mostly techno and instrumental.
    • 👌 Feels Good Man. reggae and dub. i've been listening to this constantly over the past year, haha. i just can't get over how good, deep, and rich this genre is.
    • 💑 Music for Eating started as a playlist for a dinner in 2012, now it's my general "turn something on 5 min before guests arrive" kind of playlist. it's mostly "safe", as in "nobody and their partner will get annoyed by the songs in here".
    • 🎶 Music from the Old World. i curate this one like a mad man. only good, timeless songs in here! think "if mankind would go under tomorrow, what would you save in a box and shoot out in outer space". this is music that i think are masterpieces and that has affected my interest in music somehow.
    • 🍝 Cooking. music i cook to! fun! creative!
    • 🌧 Moody. you know all these corny spotify playlists "Upbeat Summer" and that? this is the reverse. downbeat.
    • 🔫 Rhythm And Poetry. 90/00s hiphop – when it was good.
    • 🌞 Music I've Grown Up To. songs i've listened through from teen to adolescence. music that somehow has affected me during emo periods, travels, and just everyday life.
    • 🇧🇷 Bom día, Rio de Janeeeeiroo!. my brazilian playlist, which i created when i was in Rio. classic bossanova and samba mixed with brazilian funk.
    • 🇸🇪 Absolute Swedish. only swedish songs. makes me kind of proud over how much good music the little nation of sweden has produced.
    • 🛣 On the Highway. road trip songs without songs that mention "road trip".
    • 💦 Rain. for rainy weather.
    • 🇫🇷 The French Affair. french music. for when you wanna … listen to … french music?
    • 🎸 Soul/Jazz/Blues. a big ol' bucket with these three genres. bam!
    • 🍂 Autumn. moody music which somehow feels more autumn-y.
    • 🌻 Summer!. the mandatory, upbeat summer playlist. i'm sorry.
    • 🌅 What's the story morning glory. the morning playlist that gets you UP.
    • 📽 Hipster Internazionale. hipster and indie songs you haven't heard of.

    february 2nd, 2022 — 17:51 #

    from my couch in stockholm

  9. i've bought a new bedside alarm clock from Braun, and it's so pretty. when activating the back light, it glows in a cool amber light, and then fades away. drool. i have no idea about the timeline of things, but the green details feels very Apple-esque. i'd guess Apple borrowed this from Braun when the former designed the iPods, which had similar green details around the physical knobs and switches.

    BC22 Braun analogue clock

    january 30th, 2022 — 17:15 #

    from my kitchen table in stockholm

  10. i've bought a new domain for this site! from now on, it's johan.im. short and sweet. johanbrook.com redirects to johan.im.

    i appreciate these services/tools soooo much right now:

    • Cloudflare
    • Fastmail

    Cloudflare's dashboard is easy to understand and efficient enough to be dangerous — even though i'm not a DNS/networking/cache elite ninja. Cloudflare might look simplistic compared to beasts like AWS, but if you look under the hood, they support more than what they show off (perhaps they should show off more?). example: like the noob i am, i just redirected johanbrook.com/* → johan.im/*. but the paths after that slash of course weren't kept. so a URL johanbrook.com/writings would just end up at johan.im (the root). uh-oh. i read in a help article that Cloudflare's Page Rules feature supports wildcard referencing. tears of joy! so i could just do johanbrook.com/* → johan.im/$1 to keep those nice paths.

    Fastmail's wizard for adding a new custom domain is so lovely. i could even pick Cloudflare as my DNS manager, and they'd customise the wizard for Cloudflare's dashboard UI.

    january 24th, 2022 — 23:01 #

    from my couch in stockholm

  11. the artist Meat Loaf died a few days ago. his album "Bat Out Of Hell" was the first album I recall playing on CD on my brand new music player when I was ~10 years old. that album – and especially the title track – was absolutely the thing that got me listening to classic rock as a kid, and then went on to widen my interest in music overall. i have such a strong memory of playing that album in my old room.

    "Bat Out Of Hell" was so "grand and majestic", and the songs were sooo long. a stark contrast to the pop songs that was around in the 90s. and the guitar solos sure impressed me as a young child!

    bye, Meat Loaf 💖

    january 23rd, 2022 — 11:50 #

    from on the run

  12. hello world. this is me testing my new GUI for posting these small notes. i'll probably write a longer post about it later.

    in a nutshell, i've written a barebones JS client to talk with GitHub's API to post a new file in this repo. no dependencies used. it was a fun challenge writing old school DOM JS manipulations again.

    january 11th, 2022 — 22:16 #

    from on the run

  13. i'm coding together something that will let me write post and notes in my static site from anywhere, and it's super fun. need to deal with github auth and their api, learning about Cloudflare Workers, and extending lume as i go.

    the idea is to create a new post or note file with a request from an authed github session. not sure how generic i want to make this code – it could be of use for others. the existing "CMSes" i've seen for static pages are just too much.

    january 6th, 2022 — 11:55 #

  14. i've rewrote my site (using lume 💛) and made a ton of tweaks. classic neverending parental leave chores. it's built with deno, which I love even more. i'm finally free from the node/npm APIs and build systems! everything is much simpler now, and i should probably write about it in the even more classic post of "i've rewritten my blog" which usually shows up in January every year.

    january 4th, 2022 — 09:37 #

    from my couch in stockholm

  15. Summer is over, after vacation in August down on the Swedish west and south coasts. Weather was so-so, but it was nice with a change of scenery. We also spent the month of September in Florence, Italy, which was such a blast. We travelled abroad with our 10 months old daughter for the first time, and everything went quite well actually (I had expected the worst). I was so inspired by the stay in Italy, and hope I can bring some of that energy into the day-to-day life back in Sweden.

    On Monday I'll officially start my parental leave until April 2022. Scary but exciting. I'm actually looking forward to just not work for the first time in 7 years. Who knows what kind of person I'll be after this leave?

    I was inspired by the book "What I Talk About When I Talk About Running" by Haruki Murakami, so I want to start running this Autumn.

    Also, I'd like to start making my own pasta. I took a pasta making course in Florence, and it was super fun. So simple! So fresh!

    september 30th, 2021 — 00:00 #

  16. Last day in the Swedish mountains, after a week of chilling and hiking. I wonder if I'd like living here for longer periods of time, or if I'd get cabin fever. I think I'd adjust, but friends and family are far away.

    Still learning programming in Rust. Still not 100% sure of what I'm doing when it comes to memory management, but the official guide and "Possible Rust" have been of huge help. Rust feels like a very "intellectual" language (sooo much language theory has gone into it!), but I'm struck every day of how friendly the documentation and 3rd party writings on the language are. I think a super good way of learning Rust would be to actually pair program with some existing Rust programmer you know, in a non-trivial project. So that you can ask about all the small things you run into, and can be unblocked and learn forever.

    I'm going to be on parental leave from October until ~April 2022. Am nervous, but looking forward. Will be a bit weird to be off work for 6 months since I started. But I have zero doubts in that I'll be able to chill in the new role of being a parent 100% of the time. I'll miss coding for work though, BUT I guess I'll need to find myself a sIdE PrOjEct like everybody else?!

    july 9th, 2021 — 00:00 #