Blog

How to exclude running Google Analytics when running Hugo server

From: How to Exclude Google Analytics When Running Under Hugo Local Server from 2018 with love :) If you are not using a theme that already excludes Google Analytics, then you should use the following piece of hugo code. In my case, I added this code into layouts/partials/custom-header.html {{- if not .Site.IsServer -}} {{ template "_internal/google_analytics.html" . }} {{- end -}} Read more...

How to get a random number in bash

Use the $RANDOM. $RANDOM returns a number between 0 and 32767. To get a random number between 0 and 50 you can use $ echo $[RANDOM%50] $ # or $ echo $((RANDOM%50)) To get a random number between 1 and 50 you can use $ echo $[RANDOM%50+1] $ # or $ echo $((RANDOM%50+1)) Read more...

How to solve Outlook cannot parse the property 'TRIGGER'

This errors is due to what seems to be an incompatibility between Google calendar reminders and Outlook. I guess that Google uses some proprietary content in the iCal that Outlook does not manage. Result: I do not have reminders in Outlook :( but the otherwise the calendar works well. Read more...

How to split camel or pascal case in bash

Sometime you get names like “helloMyNameIsFrank” (Camel case) or “HelloMyNameIsFrank” (Pascal case) and you want to make them human readable. In bash you can use sed 's/\([A-Z]\)/ \1/g' Example $ text="helloMyNameIsFrank" $echo $text | sed 's/\([A-Z]\)/ \1/g' hello My Name Is Frank Read more...