#buildinpublic #mbsync I’m much more familiar with codeception and my brain is kinda mushy so figuring out how to do things in PHPUnit took its time. However, I refactored that storePost method now and have a test (which I wrote first or at least started to write first) to make sure it does what I want it to do. Now back to testMarkForSync.

#buildinpublic #mbsync After a late combined breakfast/lunch back at it. Still writing the testcase for storePost. I had to think about how to structure tests that rely on test data or rather needs a directory to write to. I generally like to mirror the structure of the app in my tests, so that I can find the things I need easily. I have now introduced a testData directory where I can write to/from the filesystem. It looks like this:

#buildinpublic #mbsync Well, that worked. We just had to add:

public function posts(): \Illuminate\Database\Eloquent\Relations\HasMany
    {
        return $this->hasMany(Post::class);
    }

to the Blog model.

Now we can do the following in our test:

$blog = Blog::factory()->has(Post::factory()->count(1))->create();
$post = $blog->posts->first();

That post now has some fake data as defined in my PostFactory.

Time to write this to disk. We could use PostFilePersistorService::storePost. This method makes a couple of assumptions about where to write data and I would like it to just write where I want it to. So I will refactor the path generation logic out of storePost. In the future it should be handed in via a parameter. This is a big change but we’re the only developer and in the “break lots of things” phase, so I feel this is fine.

There is only one problem: We again have no test! So what I’ll do is make the other test pass, add a TODO to it and create a test for storePost. First things first.

#buildinpublic #mbsync Well, it seems that my models are incomplete. I am missing a relationship between a blog and its posts. This is needed so that my factory can create some posts to test with.

#buildinpublic #mbsync No tests, alright. What do we want to test here? If we call markForSync() a changed post, a deleted post, a new post and an unchanged post should all be detected correctly. So let’s start with the simple case that a post in the db and in the filesystem are the same.

#buildinpublic #mbsync Continuing from yesterday. I will rewrite the markForSync method so it iterates over the posts in the db instead of the files to be able to detect deleted files as well. Just have to check if there are any tests to work with, or if I have to add them first.

#buildinpublic #mbsync It seems that I have a column in the posts table called sync_status that is enum('pending','synced','deleted') so it seems to me I need to set this to deleted if the file is missing, which implies that instead of iterating over the blog post files and marking the posts in the db I need to iterate over the blogposts in the db since otherwise I miss the deleted files. Does this make sense?

  • Files:
    • 1
    • 2
    • 3
  • Posts in DB
    • 1
    • 2
    • 3

I was checking the files against the db to find new and updated posts, but I’m now going to check the db against the files instead. I should still be able to find new/updated posts, but also posts that are missing from the filesystem.

#buildinpublic #mbsync Alright found something todo: // TODO: mark post as deleted

The way this app works is by downloading posts and keeping a hash in the database and also saving them to the filesystem. There is a rudimentary implementation for new and updated posts, but files that are deleted from the filesystem are not marked as deleted in the db. The db is what gets synced with mb though. So we need a field on the post that marks it as deleted, so that when we sync the next time the post can be deleted from mb.

One thing that always happens with this one: Don’t know what the next step is. Learning goals are for now:

  • phpstorm
  • laravel
  • tdd

So I use herd and dbngin for the local dev env and use phpstorm as the ide and realize that I have uncomitted stuff. Let’s see if the tests pass.

#buildinpublic #mbsync

Inspired by @vincent I am going to #buildinpublic. I have a nice little learning project that is supposed to be like blot but for micro.blog. I’m calling it mb-sync and I’m going to use #mbsync to refer to it.

1000 Days of Duolingo. I am little proud. I do only one lesson per day at the moment, so progress is slow. And working for a German company also doesn’t help in becoming a Finnish speaker quicker. But it’s a process. As long as I keep going, I’ll improve.

A screenshot of the duolingo web app showing off the 1000 day streak

Looking forward to EchhoFeed being available. Because then I will be aböe to crosspost from Mastodon to my blog (instead of the other way around). Which means I should be able to blog a little more without it being an ordeal.

Nice little evening walk before sleep with the dog just now. About 20 mins longer than usual. I could get used to this. But the dog is usually so lazy at this time.

Took the time while my partner was driving us back to #oulu (we were visiting my partner’s family to celebrate her aunt’s 70th over a long weekend) to reconcile accounts and balance my personal budget. On my phone. Using my bank’s app and ynab. Worked pretty well!

How beautiful are these words about person living in a city during war:

Today I stopped by my favorite flower store on Kharkov’s Avenue of Heroes. I was thinking that, if the electricity goes out during the day, I will tidy up the balcony. I will wash the windows, take out the flowers, and I’ll transplant the shoots because the roots are already kilometers long.

It’s spring. No matter what.

The sales girl meets me on the doorstep. She says: “Oh no, what are you thinking? Begonias on the balcony this early? There might still be frost at night.”

And we stand in the amazing-smelling shop with the garden roses, and together we watch the weather. The siren squeals. We look at each other, and silently move away from the windows to the fertilizer section, and we talk about the dracaenas waking up from their winter hibernation.

God, I love my city.

(found here, don’t know anything else about it, since the original Post seems to be part of medium, which I’m not a subscriber of…)

Took the plunge today and changed my theme for the first time since establishing my blog on micro.blog. I’m very apprehensive changing themes and other things that I consider default behavior. Because this either means maintenance for me or maintenance for somebody else. I’m not a very visual person especially when I have to create things. I want to write and I want it to look okay, but I’m not sweating it if the blog looks antiquated or whatever. However, a blog needs some form of a (design) theme and so I have generally opted for whatever the default is. The default is going to be maintained no matter what so it’s a pretty safe bet. One thing that irks me a lot about micro.blog’s default theme: How invisible the categories are! They are only visible on the archive page, not in the list of posts and not on the single post page either. I find this very impractical, because you can’t browse other posts in the same category. Another thing is that the default theme doesn’t do proper pagination. The homepage just includes 20 or so posts and that’s it. You have to go to the archive page to see more posts, but there they are only visible in a truncated fashion. Long story short: I changed the theme! This one is called Minos and shows the categories above every post and has pagination. For posterity’s sake, here are some more or less random screenshots from the blog before changing themes: A screenshot showing my blog using the old default theme A screenshot showing my blog using the old default theme A screenshot showing my blog using the old default theme A screenshot showing my blog using the old default theme A screenshot showing my blog using the old default theme A screenshot showing my blog using the old default theme A screenshot showing my blog using the old default theme

Digital Garden

Changelog

  • 2024-04-07 - introduced changelog, added Maggie Appleton’s garden as inspiration, introduced historical notes
  • 2024-05-20 - Added paragraph about my grandparent’s garden
  • 2024-11-02 - removed mention of the Micro.publish-Plugin since I don’t use it anymore

Note

These notes are different from other blog posts in the sense that they aren’t staying the same over time, but reflect my current thinking. All of the notes that fall under the umbrella of the digital garden will be part of the DigitalGarden category and page.

My Grandparents have beautiful garden that in my mind is as beautiful as it gets: A small refuge outside out the city of Berlin where they spend many weekends and whole summers when they retired. So much love went into this place. And at the same time it’s a relaxing oasis. A comforting place a place that connects coziness with nature.

How does this connect to the notion of a digitial garden?

Historical notes

My main point of inspiration is Maggie Appleton’s Digital Garden.