Blog

Simple CSS Loading Spinner

I recently wanted to create my own simple loading spinner with just HTML and CSS. Here is the code that I came up with: HTML CSS See It In Action Below is what it looks like in action. I added a few inputs so that you can play around with […]

By Chris West, ago
Blog

JavaScript – Async Function Constructor

In JavaScript you can create a function by using the Function constructor: The above code produces a sum() function which takes 1 or more arguments and returns the sum of them all added together. You can check out the following to see this in action: What About AsyncFunction()? You may […]

By Chris West, ago
Blog

PHP Snippet – parse_jsonc()

A few months ago I wrote a quick post showing how to parse JSONC (JSON with comments) files in JavaScript. Shortly thereafter I adapted the code to work in PHP as well: This function takes the same arguments that you can pass to the native json_decode() function. Besides removing JavaScript […]

By Chris West, ago
Blog

IO App – XML To JSON Converter

There are a lot of online converters out there that will take XML file contents and turn it into JSON. I decided to make my own and then show how simply this can be done with modern JavaScript: How Does It Work? The code which makes this work is given […]

By Chris West, ago
Blog

JavaScript Snippet – importUnpkg()

There are many websites that make it super easy to import node packages into your website. One of them is Unpkg.com. If you want to import a package into your web page or website you can try using the following: As you can see in the JSDoc annotation, this function […]

By Chris West, ago
Blog

JSON.parse() Reviver for Dates

Did you know that you can pass a function as the second parameter to JSON.parse()? Doing this causes every key/value pair to be passed to this function for further processing. You can read all about how JSON.parse() and the reviver function works here on MDN’s site. Example Reviver We can […]

By Chris West, ago
Blog

JavaScript Snippet – parseJSONC()

Last year I needed a way to be able to parse JSON with comments (also known as JSONC). With that in mind I wrote the following short solution which will essentially remove JavaScript-style comments and trailing commas from the specified JSONC string and then the native JSON.parse() function will parse […]

By Chris West, ago