JSON encoding Windows-1252 Unicode chars

While trying to use the json_encode function a Windows-1252 left and right quote character was breaking the encoding and I was ending up with no JSON. The string being encoded was from html within a PHP file. I’m guessing it was copy pasted from a Word doc. To fix this the <a href="http://php.net/manual/en/function.mb-convert-encoding.php">mb_convert_encoding</a> function, not the <a href="http://php.net/manual/en/function.utf8-encode.php">utf8_encode</a> function, was … Continued

Reading Today

For Snook



"‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬"

read full text »

Reading Today

​Organic food worse for the climate



"Organically farmed food has a bigger climate impact than conventionally farmed food, due to the greater areas of land required. This is the finding of a new international study involving Chalmers University of Technology, Sweden, published in the journal Nature."

read full text »

Reading Today

Loop quantum gravity



"Loop quantum gravity (LQG) is a theory of quantum gravity, merging quantum mechanics and general relativity. It is a theory of discrete, quantized units of spacetime because, according to general relativity, gravity is a manifestation of the geometry of spacetime."

read full text »

Workaday Reading

vimeo autoplay=1 no longer working in Chrome



"I recently developed a website that has a streaming video as its full-screen background that autoplays & loops when the website loads. It was working in Chrome until very recently. Google changed their policy on autoplaying video in April, so I believe this may be the reason."

read »

Workaday Reading

Build your own Command Line with ANSI escape codes



"Everyone is used to programs printing out output in a terminal that scrolls as new text appears, but that's not all your can do: your program can color your text, move the cursor up, down, left or right, or clear portions of the screen if you are going to re-print them later."

read »

Workaday Reading

Content negotiation



"In HTTP, content negotiation is the mechanism that is used for serving different representations of a resource at the same URI, so that the user agent can specify which is best suited for the user (for example, which language of a document, which image format, or which content encoding)."

read »

Jingle Bells While Going to Sleep

  [audio m4a="https://thisbailiwick.com/wordpress/wp-content/uploads/2018/11/ellery-singing-jingle-bells-while-going-to-sleep.m4a"][/audio]

Workaday Reading

JavaScript error reference



"Below, you'll find a list of errors which are thrown by JavaScript. These errors can be a helpful debugging aid, but the reported problem isn't always immediately clear. The pages below will provide additional details about these errors."

read »

Reading Today

Vehicle Miles Traveled



"In recent quarters, Andre Harboe has been doing good work in our office on creating and using some unique, or offbeat, economic indicators, or at least in terms of regional or state economies."

read full text »

Reading Today

A Netflix Web Performance Case Study



"tl;dr: There are no silver bullets to web performance. Simple static pages benefit from being server-rendered with minimal JavaScript. Libraries can provide great value for complex pages when used with care. Netflix is one of the most popular video streaming services."

read full text »

Workaday Reading

Player



"An instance of the Player class is created when any of the Video.js setup methods are used to initialize a video. In the following example, the data-setup attribute tells the Video.js library to create a player instance when the library is ready."

read »