Jess Maternity Photos

Jess and I headed to Kin Beach in Vernon to take some maternity shots this weekend we’d been planning it for months, and they turned out better than we hoped.

It’s been a long hard road. I don’t think I remember anyone ever saying pregnancy was easy, but we didn’t know it would be this hard. I guess for the unlucky like Jess it can be tougher than expected; the morning sickness, the pain, the emotion, and constant discomfort. Sadly Jess has suffered through the entire thing, while still trying to be strong and working full 8 hour days throughout, as well as dealing with everything life threw at her. She’s been amazing, and it’s been a struggle.

I’ve gained a newfound respect for Jess, and for that matter, any woman who’s had to put up with a difficult pregnancy. It’s something us guys will never understand or comprehend.

Jess and I are told that once it’s over, we’ll nearly immediately want another; I find that impossible, but I wouldn’t be surprised either. Until then, 2 weeks and a few days to go. I can’t wait to meet my daughter and finally see Jess not in pain.

Emoji short name’s to HTML HEX Code via PHP

I’ve been working on a Slack App that shows recent Slack posts and activities. The majority of recent posts include emojis, and problematically Slack’s API doesn’t store and send emojis as characters, they’re down-converted to their respective shortnames, then wrapped in colons (presumably for universal support – it appears to be a standard practice of some sort, as many use it).

Basically I was just looking for converting

:thumbsup: to convert to: 👍 which’d show: 👍

Simple enough task, but I couldn’t find any resources to do it (and if you’ve discovered this blog post, you’ve probably discovered that out too). So, starting at the top, Slack in their API docs refers to using github.com/iamcal/emoji-data as their emoji shortcode source. This repository does have a PHP script, but it doesn’t convert as simply as I wanted it to, and it’s huge.

Taking a step back, iamcal/emoji-data has a enormous master .json file, basically a database of each emoji and all variations therein. Taking this file, and running through it with some basic PHP, we can build a simple array of shortcode => hexcode. Doing this was almost too easy:

We then take the output of that file, and create our own emoji_unicode.php file, an array housing the values output above. Which looks like:

Much smaller and easier to work with. 97% smaller actually coming in at: 35KB instead of 928KB. I’ve hosted the file on github here.

So with a simple array to call back to, we can just include it, search the string for the colon’ized shortcode emojis and replace with hex code, like so:

Which’d output

> hello 🌎 . it’s 🔨 ⏱.

This works with :skin-tone-x which surprised me- I guess the skin-tone is a “invisible” character of it’s own, that basically gets compounded with the emoji character before it, and changes the emojis that way. Pretty cool, so no extra work for that. (And no, this method doesn’t work on devices that don’t support emojis).

Kindle Currently Reading on Panic Status Board or Website

Here’s a neat little widget that’ll fetch your currently-reading and read books from your Goodreads shelf, and show them as a widget for either Panic Status Board (DIY Panel), or your website. Code is inspired and built upon from a great little 2013 script from flapane.com

First, some styling:

Setup, query and cache:

Read and output:

You’ll need to create empty file goodreads.cache manually, in the dir of the script.

I’m not entirely sure what happens when there’s more than 1 currently-reading. I never bothered checking.

$image_fix is nasty, I don't understand why the Goodreads user API would not return a cover when the cover is present on the Goodreads site itself. I had to do a fix for one of my books, manually tracking down the cover's URL on Goodreads.com.

<?= (98/147)*54 ?> is my ..interesting.. way of doing proportional scaling on the fly. Old width/height values kept prior to overwrites for reference; makes sizing your widgets books covers to much easier.

filter: grayscale(100%); Keepin' it real with Kindle, grayscale the covers.

404’s Are Server, Not WordPress’s 404

Frustrating problem I’ve had happen more than once. Your WordPress site returns a 404 (which you may be relying on), but it shows a HTML (server generated) 404 page, not a WordPress 404 page.

Solution for apache is simple: let the server know to revert to index.php when the header is 404, set the following in .htaccess

Voilà

It’s Pink!

For a week we held onto our ultrasound result containing the answer to if it’s a little boy or girl. We gave the sealed envelope to her family, who then gave it to a baker. The baker injected the cupcakes with either blue or pink icing.

We all got together, had a really nice day, and here’s the heart warming seconds when Jess and I found out that our little baby is going to be a girl (we were convinced it was a boy, the cupcakes even seemed to have a hue of blue to them). With a mouth full of cupcake, she cries out ”It’s pink! It’s Pink” then begins to turn to mush for 15minutes.

Amazon Kindle PaperWhite’s Screensaver – Concept Solution

I love my Kindle PW 3 (FW: 5.7.4.1), but I hate the screensaver, it’s like Motel art. Thrift store art. It’s terrible and only belongs on napkins at the dollar store. I would Jailbreak it, but the current FW version has made it pretty much impossible without soldering things.

So what’s left to do? I can continue just placing it face-down on my nightstand, or, come up with a concept design and try to get someone at Amazon to read it!

I understand the non-native support for managing screensaver locally: say if a folder /screensavers/ was accessible via USB; users would be uploading bad resolutions, huge raw 12mb files, etc. and the cropping and grayscaling would be unpredictable and unsatisfactory. Any local image editor, would not likely work given the Kindles graphic processing. So, that’d be a nightmare, hundreds of support calls. It’d be far worse if the Kindles Browser had to be used for screensavers; even more problems.

However, Amazon has an eco system already in place to manage more advance things like this: amazon.com – Account – Manage Your Content and Devices . Here is my concept on how easy it could be to manage custom screensavers (for users who’ve spent the $20 to opt out of the Ads):

Kindle Custom Screen Savers

Pretty simple implementation, using no technology that’s not readily available. Set screensaver pushed to the Kindle just like a device name-change or a new book purchased via a computer!

Users would upload normal coloured images, of whatever resolution, then an HTML5/JS image editor would auto black-and-whites, and crops for the proper aspect ratio. Taking things a step further, since converting to grayscale is never what one expects: make things a bit more customizable with brightness and contrast controls. This would be okay for novice users to understand (as it’s all the same steps Instagram uses, or Facebook profile pictures).

Important: THIS IS A CONCEPT. Not actually a tutorial. I know you’re desperate for this to be real: so am I.

Object Buffering Not Working Flush

One of my servers handled object buffering fine, the other wouldn’t partake. After hours of searching, and changing php settings, deep in a thread I found a solution for stubborn servers. If the following simple script doesn’t work out the gate:

Try this instead, from a gentleman named Roger in Stackoverflow :

A nasty work around that works beautifully, and I hope it helps you.