Since I spontaneously decided to teach myself frontend development, I thought I would start by making myself familiar with common tools used in frontend development. Up until now I have been tangentially aware of what it takes to create a frontend, but I have never taken the time to read up on any specific topic. I will divide the tools into four categories: development tools, build tools, deployment tools, and, of course, other tools.
[Read More]I am teaching myself frontend development using vue.js
Warning: This is somewhat of a rant.
Off to a great start
This week I have been toying around with the idea of doing something that would involve some processing on the frontend that goes beyond submitting a form to the backend.
After some googling, I decided to try out my idea and set up a vue.js project. The easiest way to get started seemed to be to use my preferred IDE and set up a starter vue.js project with all the default settings. Ok, done. Find a little beginner tutorial and make some changes to the example component, and that also works immediately.
[Read More]Using *.env-files everywhere
Many tools automatically look for a special file called
.env, which contains KEY=VALUE pairs, one per line. I am here referring to a file with the same syntax, but with arbitrary names. I use different names to distinguish between configurations for different development stages.
Using environment variables for configuration is pretty much accepted as good practice today for web applications. But it’s always a hassle to deal with them during development, if you are not using a specialised service for them. My current approach is to create separate *.env-file for the development and testing stage: development.env and testing.env. These files use regular bash-syntax for variable declaration:
Advanced git: Using git bisect to find buggy commits
While every developer today probably has a working knowledge of common git-commands for everyday life, there are some more obscure commands that fewer people know about and even fewer people use. One of these is git bisect. If you ever had a broken build and a large number of commits that had been pushed since the last known good build, then you will very much appreciate, what git bisect can do.
What is 'git interpret-trailers?' used for?
git is the de-facto standard for version control these days. As a software developer, you will be comfortable using common git-commands, like init, add, commit etc. However, there are some quite exotic git-commands out there. One of my favorite – that surprisingly few people seem to know about – is git bisect, which can be incredibly useful if you need to identify which commit introduced a breaking change. Especially, if there are a large number of commits that you need to go through.
End-to-end email testing with testmail.app
While working on MembershipNerd I was looking for a very simple service that would let me write automated, end-to-end tests for sending emails. In particular, I wanted to create an automated test for the sign-up process. By “end-to-end test” I mean that I actually want to send an email, with a real SMTP server, verify that the email has been received by the recipient and contains the correct information.
If I simply wanted to verify that the sign-up triggers an email, then I could use the built-in email service of Django’s testing framework.. If your web framework doesn’t such a convenient way to test email, you might want to have a look at MailHog. Be aware it needs more setup though!
[Read More]Researching hosting options for small projects
Today I spent most of the day researching small cloud providers and “self-hosted PaaS” technology. This was triggered by a question that had been on my mind for a while: What is the minimum “cost-per-application” for production-quality containerized hosting?
What do I mean by that?
- cost-per-application: How much does it cost to host one application, two applications, etc.? Ideally, I would like to find the minimum price that will scale linearly.
- production-quality hosting: This obviously depends on the availability and performance requirements of the application. I will try to set the bar as low as possible in terms of availability and performance.
- containerized hosting: Basically, I want something like kubernetes, docker swarm etc. I won’t require a multi-node setup, but obviously that option would be nice.
After hours of research I have not found a good answer. But I have found some interesting technologies that seem worth checking out (in no particular order):
[Read More]Fixing the Google Search Console error 'Bad escape sequence in string' when using hugo and JSON-LD
If you use JSON Linked Data (JSON-LD) to add Google-friendly structured data to your website, you might have come across the following error in your Google Search Console:
Unparsable structured data
Structured data with syntax errors detected
Bad escape sequence in string
Looking at the search console’s help page for that error reveals the following information:
| Error type | Description |
|---|---|
| Bad escape sequence in string | An invalid escape sequence used in a string value. For example: “description” : “Some \q unknown sequence” |
In my specific case, the single quote character ' in the original text was being transformed into this mess in the JSON-LD description field: \x26rsquo. This is mixture of unicode and HTML entity. :) \x26 is unicode for the &-character. And &rsqou is the HTML entity for the original (right) single quote '-character.
A pure JavaScript cookie-consent-banner for Google Analytics
Disclaimer: I am not a lawyer. This is not legal advice.
Disclaimer: I am also not a JavaScript developer. So don’t take this as JavaScript programming advice. :)
I like to know how many people visit my website, and what articles they are reading. Why? Because I find it can be quite motivating to see these numbers go up.
Because I am located in Germany, I need to provide a way for my site visitors to explicitly give their consent. Since the advent of GDPR and the European Cookie Law, there are many, many companies that offer services to help website owner with this. But I am software developer. I am not going to pay a monthly fee for a simple JavaScript pop-up! (Yes, yes, I know, these companies provide more than that. I am just trying to be funny here.)
[Read More]