Tag: programming
-
My 10 simple UX rules
Creating a user interface that offers a positive user experience (UX) requires a certain level of skill, and admittedly, design is not my primary area of expertise as I am a programmer. Nevertheless, I have gathered some fundamental principles over the years that aid me in delivering a satisfactory user interface. 1. Always respond to…
-
VSCode keyboard shortcuts I’m actually using
in programmingVisual Studio Code contains centillions of keyboard shortcuts, but in everyday life I use only a fraction of them. I have also mapped them to key combinations that are easier to access. These three-finger shortcuts are really crazy, while others I never use, like “Cursor Undo”, are mapped to “Ctrl-U”.Your mileage may vary, but I…
-
How to loop through an array with a variable starting element
in programmingRecently I was faced with an interesting problem. I needed to create a simplified (pseudo-) cron interface: The task is to find the next selected day.
-
The modern way of checking radio groups
Checking radio groups in JavaScript has always been a bit tricky because you can only check if a particular radio button is selected, not the whole group at once. Wow, that looks archaic. There must be a better way using the new ES6 features, and there is! As of ES2015, NodeList contains a forEach method().…
-
Using JavaScript modules in your WordPress plugins
in wordpressModules are nothing new in JavaScript programming, and it’s a good practice to modularize your code. WordPress does not offer the option to load scripts as modules out of the box. There’s a ticket from mid 2022, but it hasn’t gained much traction yet. So we need a workaround for the time being. Fortunately, WordPress…
-
Chrome side panel: Simulate close event
in programmingThe new side panel in Chrome does not contain a close event, which could come handy if you want to clean up stuff after the panel has been closed. You can simulate the event by opening a permanent connection between the side panel and the background script. This connection fires an onDisconnect event if the…
-
How-to split a number into equal chunks
The other day I had to iterate over a large number of items but to avoid a timeout I could only compute a certain amount at a time. So I had to split the number into equal chunks and a remainder. Here’s an easy way to determine the chunk size: The code return the following…