Simple multi-language pre-commit hooks
This is one of the posts that spent months in draft (fka ideas) mode. Recently I got to convert some people to use the tool described by this post, so I thought I might as well add some context to it.
Notes from the Laboratory: July 2022
I am trying this new “thing” of “reporting” what I was up to in a certain time period this year, and monthly reviews just sound like something normal people would do. So bear with me while I am typing up this report.
.gitignore for GoHugo
This is a slight update on my previous post about the perfect .gitignore file for GoHugo. TLDR: The current optimum .gitignore content for a GoHugo project is the following (in addition to your own ignored files and folders): 1/public/ 2/resources/_gen/ 3/assets/jsconfig.
Less Clutter in Vscode
I am one of these kind of people that install plenty of extensions and tools and experiment around in VSCode (or any other code editor I am working with). Some time ago I realised, that this lead to a slow program and many of these plugins are only useful for a limited number of projects.
Notes from the Laboratory: June 2022
I am trying this new “thing” of “reporting” what I was up to in a certain time period this year, and monthly reviews just sound like something normal people would do. So bear with me while I am typing up this report.
Music to program to (Part 6)
A song written for David Lynch’s Twin Peaks revival, but ultimately denied by Lynch. He asked for something different and received a very well fitting She’s gone away which lead into the probably greatest episode of TV of all time.
Swapping swap
Short Interlude: The following problems and it’s solution seems to be an Ubuntu 22.04 issue, because that is when the new OOM service was introduced. Read on if your Ubuntu system closes applications when it seems to be overwhelmed by tasks and if it’s a 22.
Notes from the Laboratory: May 2022
I am trying this new “thing” of “reporting” what I was up to in a certain time period this year, and monthly reviews just sound like something normal people would do. So bear with me while I am typing up this report.
VSCode Remote SSH plugin vs. Dreamhost shared hosting
I finally had a reason to edit a website with VSCode directly on the server. VSCode comes with an extension, the Remote SSH extension. I thought this will connect with the SSH server and make the filesystem available like a mounted path.
Piping output to files in Bash
There is a recent commit in GoHugo’s repository that removes several CLI parameters I was using in my projects. Those flags were --debug, --log, --logFile and --verboseLog. While I am not discussing this decision (I don’t like it, but I understand that keeping these things in the software needs someone able to keep them up to date and conclusive and the developer of the software seems to be unable to) I am still interested in the idea of having a file with all output of my Hugo runs available so I can parse through it and see what is going on while building the site.
Better code highlighting for Hugo with render hooks
One of GoHugo’s problems is, that the focus is mostly on speed. Simple HTML rules are prone to be ignored or freely interpreted (for instance, in the internal templates). But it offers ways to override and configure things, so not all is lost.
Notes from the Laboratory: April 2022
I am trying this new “thing” of “reporting” what I was up to in a certain time period this year, and monthly reviews just sound like something normal people would do. So bear with me while I am typing up this report.
Autostart Development Server in Vscode
Are you annoyed of the two clicks and one line command to start your development server (or development watching process) each time you open VSCode? Then I can help you ;] I recently and finally got around to read through all the docs and found out that there is an easy way to do this in VSCode, via “Task configuration”.
Notes from the Laboratory: March 2022
I am trying this new “thing” of “reporting” what I was up to in a certain time period this year, and monthly reviews just sound like something normal people would do. So bear with me while I am typing up this report.
Hugo 0.96 update notes
Hugo 0.96.0 was published last weekend with two new features and many smaller changes and fixes under the hood. Here is a quick overview of the release. New features Vertical merging of content mounts Under this title hides a useful feature for Hugo Modules that mount content directories.
#100daystooffload
I recently started taking part in the #100DaysToOffload challenge. It’s a challenge that tries to create a larger output of content that is interesting and useful. I will try to write about the topics that I have learned during this time while still staying to be the nerd that I am.
Shouting Alexa at a Pork Pie
This really important video about Alexa is a great example of how to use the Alexa API to create a skill. Not really, but watch it until the end to understand ;) From the videos description: Some interpreted it as a commentary on our over-reliance on consumerism, or of the unrealistic demands we make of material possessions.
Music to program to (Part 4)
Ólafur Arnalds remix of Rammstein’s “Zeit” is something perfect. His own notes about this from Facebook: When I was 15 years old Rammstein came to Reykjavík. This was going to be one of the biggest shows in Icelandic history. Me and my friends went and headbanged our teenage hearts out.
Hugo 0.95 - Update Notes
Hugo 0.95.0 brings some really useful features (next to smaller speed increases as always) and upgrades the used Golang version to 1.18. New feature: {{ break }} and {{ continue }} break and continue are keywords known to developers of any programming language.
The Pentaverate
Mike Myers does that thing where he plays multiple roles in the same movie. What if a secret society of five men has been working to influence world events for the greater good since the Black Plague of 1347? As this new series begins, one unlikely Canadian journalist finds himself embroiled in a mission to uncover the truth and just possibly save the world himself.
Hiding UpdraftPlus nagging screens after your subscription ran out
Nagscreens. You know them. Very annoying. Long story short: I recently stopped updating my subscription to a paid WordPress plugin and it started using nag screens to guilt me into renewing the subscription again. In this specific case we have the UpdraftPlus plugin that I really suggest everyone to use, but it did not really add new features or did anything else to make me feel like having a yearly subscription for the simple backup plugin would be something I want to do.
Create a Branch From Within an Issue on Github
You can now create a branch directly from an issue to begin development work that’s correlated to that issue. Branches connected to an issue are shown under the “Development” section, which has replaced “Linked pull requests”, in the sidebar of an issue.
Ubuntu, EFI and Acer
A while ago I found myself in front of my little baby-notebooks screen telling me in no uncertain terms, that “No Bootable Device (was) found”. Hmm. Somehow I remembered that. I also remembered that it’s just a little renaming routine that would solve this annoying issue.
Hugo Shortcode: Taglist
I needed a Hugo shortcode to show a list of posts that belonged to a certain tag, which is quite easy. Add the following to layouts/shortcodes/taglist.html
or whatever name you like to use for the shortcode.
Notes from the Laboratory: February 2022
I am trying this new “thing” of “reporting” what I was up to in a certain time period this year, and monthly reviews just sound like something normal people would do. So bear with me while I am typing up this report.
Creating a GPG Key for Github/Gitlab Deployment
Every now and then I have to add a GPG-key to one of my projects. Last week for instance a key expired that I used for a year to sign my commits. And every time that happens, I have to google how to create my key again.
Notes from the Laboratory: January 2022
I am trying this new “thing” of “reporting” what I was up to in a certain time period this year, and monthly reviews just sound like something normal people would do. So bear with me while I am typing up this report.
Google's new (?) Not Found animation
Google has a nice little animation when you end up on a search result with no results. It’s a little blue monster fishing. Click it and it will start fishing for something. A fish, or a tin of fishes or, well, look for yourself.
Just another New Year
Every year my feeds (yes, I am still reading my news via feeds) are filled with New Years resolutions and Old Year reviews. I myself dabbled in it a while, but for the past 10 years I gave up on this.
Music for the New Year
Some mellow music to let the year run out to. No more programming for at least 10 hours ;)
Earth's Black Box
It looks like earths climate catastrophe now has it’s own black box. Earth’s Black Box will record every step we take towards this catastrophe. Hundreds of data sets, measurements and interactions relating to the health of our planet will be continuously collected and safely stored for future generations.
Hyper Shell
There is nothing, you can’t do with Electron, apparently. Newest proof is Hyper, a shell inside of Electron (you read that right). Developed by Vercel, the app is theme-able and extensible by plugins, like any other Electron app. It doesn’t look though like any init scripts like .
You got to...
… subscribe to Stefan Judis’ Newsletter (click this link, load his site, scroll to the footer and subscribe). Trust me. It’s good. Weekly. His topics touch everything web development related and there is never an issue from which I don’t learn something new.
Converting frontmatter in GoHugo
Some days ago I realised, that I keep all my configurations for GoHugo in the TOML format, while using YAML for the frontmatters in my content folder. That did not seem right ;) so I changed those too to TOML.
Learning to git with git
I like to learn things by doing them. Recently I found a couple of interesting game formats that teach certain aspects of full stack developer’s life by playing a game. Let’s play? Oh My Git! is a game to learn Git, by using Git.
Well... that's a unique... logo?
I had a weird reaction (““well… that’s a unique logo?”) to my really great weblog logo above recently, so I thought I might as well explain it.
Print ordinal date suffixes (1st/2nd/3rd/4th) in GoHugo
Golangs $date.Format is unable to add ordinal suffixes to dates (like 1st, 2nd, 3rd, 4th). Let’s not judge Golang for that. The following is how I remedy this issue: layouts/partials/func/formatOrdinalDate.html 1{{- $format := .format -}} 2{{- $date := .date -}} 3{{- $shortened := "th" -}} 4{{- if in (slice 1 21 31) $date.
CSP vs. syntax highlighting in GoHugo
If you are using the code styling functionality of GoHugo then you might have stumbled over a common issue when you are using Content Security Policies (CSP) and inline styles. Using CSPs is the proper way these days to secure your site code but it is considered (in the realm of CSPs) bad style to have your style sheets or JavaScript inlined into your page.
Giscus Module for GoHugo
Giscus is a new star on the comment systems for static website generators orbit. It is inspired by the wonderful utterances and uses Github Discussions to save comments. It’s open source, easily configurable, themeable, translatable, and you can host it on your own server (it’s JavaScript based) if you like.
Game Off 2021 Part I
Game Off 2021 is this years iteration of a regular game development contest hosted by itch.io. I decided a while back to develop some form of program or game just because I can. This is the perfect opportunity to force myself to do so and I’ll program a little game throughout the month of November.
(Another) new beginning
Hello again, Internet! You might not know me, but you probably already somewhere came across my work or myself if you ended up here. My name is Patrick (born 1975). I am a German, living on Koh Samui in Thailand and I am a web worker.