Notes page 4

29 - Kept working on deploying the new version of my site today. I think I got to the point where it builds totally fine but I am actually hitting the limit on the free vercel hosting for serverless functions 🤦‍♂️

I'l' either see if I can make more of my site fully static, or I may have to go with self hosting - which may be the better option in the long run anyway

Grant Richmond

28 - Relatively slow progress on my site happening today...

I attempted a first deploy on a test site and I have the backend part up and running ok after a bit of faffing about, but the frontend won't build correctly yet. I think it might just be because there is no content in the database yet, so it's causing an error. Will inspect further tomorrow!

Grant Richmond

#100days 27 - Uhhh I got a switch the other day so of course animal crossing has cost me a day in my #100days project 😅

But I was back at it today with a small update to the Next.js port of my site - I got the gallery view working pretty well. It could definitely be improved but it is the same as it currently is on my live site so that will do for now!

Grant Richmond

#100days 26 - Got a shipment of new nerdy stuff from China so went to work trying to set them up. I got a couple of light sensors working without any problems, so I will use them to more intelligently manage my lights. But the LED strip controllers I got are a little more difficult, I would love to install a more useful custom firmware on them - so I tried with one last night, but to no avail (probably do to my bad soldering). And the other controller (which I have not modified) does not seem to be working as it intended either. I may have a second attempt at flashing my spare one tonight and see how it goes.

Grant Richmond

25 - Just a quick and fairly pointless but fun update to my telegram bot: I added a /say command that will echo whatever it receives as a voice over my home speakers.

Grant Richmond

24 - Doubled down on updates today and made another small fix to the upcoming Next.js version of my site and fixed the single article view, it was previously always showing a compact version, but now it understands that it is a single full page and shows the full content of a post

Grant Richmond

23 - Today I returned back to a long abandoned project, my home automation chatbot. My lovely girlfriend mentioned that she saw someone else had made an "attention button" for their girlfriend and whenever it was pressed it would flash their lights and let them know that attention was required.

I thought "I can do that!" so I did! I quickly set up a Node-RED flow that sets off my speakers and flashes my lights if I'm home, if I'm not home it sends a notification to my phone.

To trigger this I setup my telegram chatbot with an /attention command, and allowed it to work in our own private group. So now my girlfriend can control my house as well and request attention whenever she wants.

Grant Richmond

22 - I'm still one day behind but I promise I'll get 2 updates in tomorrow.

Today was just a quick update to my updated Next.js site - I added a little function to generate titles automatically based on content. "Photos page 3" and the like.

Grant Richmond

21 - Basically no progress on the PostrChild extension, I think (but don't know for sure) that is an issue with the react portal system. Calling a function defined outside a portal from inside a portal and the state variables are always their initial value. I tried using custom js events to get around it as well as setting up some better global state management.

Grant Richmond

20 - small step forward and a smaller step back. I tried adding a ctrl+enter shortcut to publish with the PostrChild extension. The actual shortcut works and runs the publish function, but for some reason when it is run via the shortcut it doesn't pick up the content. Something to try and figure out tomorrow!

Grant Richmond

19 - Small but good progress today on the PostrChild extension, the new post from anywhere button works like a charm. I hit that and it opens my website and loads the editor really quickly.

But I didn't manage to get the reply button working just yet. It requires passing some data into the newly created page, which I haven't quite fully figure out yet. Hopefully tomorrow though 😃

Grant Richmond

18 - Just a small one. I setup the PostrChild extension to automatically save the new post url, which means that the extension can launch a new post editor from any page. Although I seem to have issues with the popup being really slow now (I think a bad react hook), so it's not fully tested yet.

Grant Richmond

17 - The next.js migration continues! I'm actually feeling quite close to having something working now, I fixed a lot of things that were just straight up broken today like watch posts and seo titles.

There is still quite a lot that is missing - but not actually broken, so I am tempted to start building and deploying some of this to a test site. I am slightly worried that statically generating everything will make the build process excessively slow, even though I have tried to do some caching now, but luckily I can configure all of that - perhaps statically generating the most recent 50 posts and dynamically generating the rest makes sense.

Grant Richmond

16 - More website migration work! Pretty happy with the separation of frontend and backend now, I think it should work well :)

Today I did a lot of work on the admin functionality and tidying up a lot of code and transferring old custom functionality like my pay page.

Grant Richmond

15 - Made a lot of progress porting my site to Next.js. It's been quite a pleasant experience so far. The static generation abilities are really powerful now and I managed to make a first - totally unoptimized - static export of my previously fully dynamic site, it might have taken 17 full minutes to run, but it did successfully generate thousands of static pages.

Lots more work to go on it but it's definitely a good start and I am very much looking forward to the upcoming Next.js features.

Grant Richmond

Wow Next.js just keeps getting better and better for me! 9.3 and 9.4 have both released absolutely killer features that I will 100% be using as I migrate my site 😃

Grant Richmond

13 - Did some work on integrating my bathroom scale into my home automation.

It's sort of wildly over-engineered but I love it.

I have a raspberry pi near my bedroom with a script running that can read results from the scale via Bluetooth, it then sends the data over mqtt to my home assistant box at the other side of the apartment and that stores the information and runs an automation.

The automation gets the new data compares it to the last weight and then speaks it on the nearby Google home.

The result is I step on the scale, it shows my weight, then the Google home tells me the change since last time, my bmi and my fat.

I am 100% reporting my fat wrong, it's either - it is reporting "visceral fat" which is not the same as body fat percentage, so I need to change something somewhere. But all the data is there it's just a case of doing some simple calculations or changing what the speaker tells me.

Bonus video: https://grant.codes/media/2020/05/13/1589409504701.mp4

Grant Richmond

12 - Figured out the issue I was having yesterday with inserting replacing the editor element instead of inserting it as a child.

It was fairly involved meaning removing sibling elements and adding them again later on. But so far it appears to be working great for me.

This is pretty important in an editor that can handle alignment - which the PostrChild extension does. It means there is no extra effort needed to style the content when it is in the editor vs when it is live on the site.

Still lots of work to go, especially around the suggestion functionality but I feel there is a bit more progress again and I am using PostrChild more to write these updates

Grant Richmond

11 - I didn't get around to writing an update yesterday but I did do a bit of unsuccessful work on the PostrChild extension. Trying to replace existing elements with react instead of creating children inside them, but it's quite tricky. I'll try again today by clearing children from the parent before re-adding them with a portal in the correct position.

Grant Richmond

10 - Figured out the issue from yesterday and got the right click send to media endpoint functionality working. I needed to request the correct permission for it to work. So now I can right click just about any image and save it to my own site.

Grant Richmond

9 - I started working on trying to add a right click context menu to the PostrChild extension, but no luck so far. I've not been able to get it to appear. I also should work on the web extension development workflow as it is a little clunky at the moment.

Grant Richmond

8 - Set up the new feeds plugin on my site so I've got rss, atom, json feed, jf2 and microformats json feeds for my content.

It could probably do with some more filtering, like options for post types to show up in the main feed and add feeds for individual types and categories.

Grant Richmond

7 - Fixed up the Postr feeds plugin I started ages ago and pushed it up to the repo. Will see if it's safe to use on my own site tomorrow!

Grant Richmond

4 - More issue wrangling.

Got all my issues for the updated PostrChild extension organized in a GitHub project.

Hopefully I'll be able to start picking off a few of these issues every day.

Grant Richmond

Day 3 of my - organized a project and a bunch of issues to cover everything that I want to do with my website. In particular you can see my plans to move to Next.js in the project and a few more future plans in the issues

Grant Richmond