What's been on my mind

Selectively disabling Bootstrap tooltips for form field elements

Submitted by charles on

On a Drupal 8, Bootstrap based site that I’m currently working on we have a couple of forms that have a boolean ‘Acknowledgement’ field that is displayed at the bottom.

Because we’ve enabled “Smart form descriptions (via Tooltips)” in the theme settings, the form field descriptions are not visible, but in this case we wanted to display it below the field, instead of as a tooltip.

Cape Town 1.6°C above normal in 2018

Submitted by charles on

The New York Times has a tool on their site which allows you to check how much warmer a city was in 2018, compared to an average calculated using data from 1981 to 2010. The data, provided by AccuWeather, comes from a database of more than 3800 cities worldwide which shows that about 83% of cities experienced average temperatures higher than normal last year.

Copying multiple words in PhpStorm

Submitted by charles on

To copy multiple, non-adjacent words in PhpStorm, option click at the start of each word, then hold option and shift and hit the right-arrow key and each word will become highlighted. Ctrl + c to copy and then move to where you want to place the copied words and paste (Ctrl + v). You can also add extra text before or after the copied words, and the extra text will occur in the same place on each line from which the words were copied.

 

"Plastic Nightmare": a presentation in Kommetjie by Surfer and Scientist Dr. Tony Butt

Submitted by charles on

Surfer and oceanographer Dr. Tony Butt, who has been a regular at the big wave spots around the Kommetjie area over the years and who has given talks about the science of waves and geomorphology, spoke again this evening at the Kommetjie Surf Shop, but this time it wasn’t about surfing or the formation of waves, rather he presented his research and thoughts on this “Plastic Nightmare” we are living in and are all contributors to.

Prompting a user to confirm navigation away from a page using the "beforeunload" event in javascript

Submitted by charles on

To brush up on, and solidify my javascript knowledge, I'm currently going through the book "Eloquent Javascript", and came across the brief mention of "load" and "unload" events. I'm well aware of and use the "load" event all the time, but I haven't actually needed to use the "unload" event in any custom js code of mine before, so while the book doesn't really go into any detail I looked at the MDN's "beforeunload" documentation for some more info.