Recently I had the pleasure of building a calculator example exercise. Begin a good programmer I used the some HTML entities as values on the buttons: ×, ÷ and ± as values. It turned out to be quite difficult to parse them with native JavaScript. It is not so hard with LoDash or jQuery, but I wanted to do it native.
When you want to display code, you are probably using PRE elements. The fact that these elements can contain markup makes them perfectly suited for syntax highlighting. Some plugins make it easier to copy the code using a button. Google Prettify has no such option. Let’s see if we can make copying easier by providing a “double click to select all”-feature to our pre fields.
I love SASS. What’s not to love? Well… it can’t be served directly by the web server like CSS. It needs to be pre-compiled before it is served. Fortunately there is a PHP SASS compiler that can be used to make PHP compile and serve SASS. I’m using an IIS installation, so I’ll be explaining how it can be done on a Windows machine.
Sometimes you’ll need a (slightly) better C# WebClient that’s able to store/retrieve cookies, prevent redirects or retrieve the HttpStatusCode of a request. I’ve created a small class that facilitates these features.
Doing calculations on Knockout data-binds might result into a “Uncaught SyntaxError: Unable to parse bindings” error. Solution: use an anonymous function!
While working with the Chrome Developer Tool, I’ve discovered that you can retrieve the XPath of a selected node. But… it only works in Chrome. So what about other browsers? What about jQuery? What about querying documents that resulted from an AJAX request?
MP3s are everywhere and back in 2014 I finally had a phone with enough storage to store a decent amount of them. I use MediaMonkey to add high resolution album covers and to rename the files in a predictable format: Artist – Album – # – Title. The only thing I was missing was a simple way of creating a M3U playlist: PowerShell to the rescue!