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!
Sometimes you need to test if two files are the same. As files are getting larger, your scripts will take longer, so we need to look into performance. In this article, I’ll show how to compare two files using a buffered approach in PowerShell.
Yesterday I was working on a bit of code that had to read the XMP meta data from a file. It is not located at a certain position, so I had to scan the file. XMP, being plain XML, can be found by simple string matching. After some searching I’ve found many solutions that read the entire file into memory and perform a regular expression search or a string comparison. That’s not going to work for me, because I have files that are +100MB! So I wrote some code that does a search that performs.