Turning an eInk screen into a monochrome art gallery

by @edent | , , , , , | 6 comments | Read ~5,139 times.

Previously on Terence Eden's Blog: I turned an old eReader into an Information Screen. This time, I'm taking a different Nook, and turning it into a magic gallery. Here's what it looks like in action: Upcycled an old eReader into an art frame.Displays a new black & white piece of art from Flickr every few…

Minimum Viable Tweet to Semantic SVG

by @edent | , , , | 3 comments | Read ~232 times.

The Twitter logo.

One of the problems with OEmbeds of Tweets is that they're heavy. Lots of JavaScript, tracking cookies, and other detritus. See this excellent post by Matt Hobbs looking at how to make your website faster by removing Twitter embeds and replacing them with images. Here's my attempt to turn a Tweet into a semantic SVG!…

Adding Semantic Reviews / Rich Snippets to your WordPress Site

by @edent | , , ,

Screenshot of JSON code in a web page.

This is a real "scratch my own itch" post. I want to add Schema.org semantic metadata to the book reviews I write on my blog. This will enable "rich snippets" in search engines. There are loads of WordPress plugins which do this. But where's the fun in that?! So here's how I quickly built it…

Remove the first few lines from a string in PHP

by @edent | , , | 1 comment

Binary code displayed on a screen.

Problem: I have a multiline string - not a file - and I want to remove the first few lines from it and keep the rest. I found this surprisingly unintuitive. So these are notes in case I want to do it again. Feel free to suggest a better way! Example Given this input: $str…

Quick and Dirty Self-Hosted Alexa Skills (2019)

by @edent | , , , , , | 3 comments | Read ~1,188 times.

I hate creating Alexa skills. What should be a 3-click process inevitably ends up requiring trips to multiple websites, to set up weird parameters, and reading outdated tutorials for obsolete libraries. So this is how to create a self-hosted Skill, using PHP. It runs on your own server and doesn't require any interaction. The Skill…

Import Images From A Migrated WordPress

by @edent | , , , , | 2 comments | Read ~464 times.

The Logo for WordPress

Here's how to solve a common WordPress problem. I want to re-import all my blog's images into the media library. I've moved my blog to a new host - but kept the same domain name. I started with a new WordPress install, the uploads folder still has all my images, but WordPress can't see them.…

A UTF-8 Aware substr_replace (for use in App.net)

by @edent | , , , | Read ~1,147 times.

So, I stayed up bashing my head against a brick wall all last night! PHP's string functions aren't (yet) UTF-8 aware. This is a replacement for subtr_replace which should work on UTF-8 Strings: function utf8_substr_replace($original, $replacement, $position, $length) { $startString = mb_substr($original, 0, $position, "UTF-8"); $endString = mb_substr($original, $position + $length, mb_strlen($original), "UTF-8"); $out =…

Introducing a NEW QR Generator

by @edent | , , , , | 4 comments | Read ~1,039 times.

When people ask me which QR generator to use, I usually suggest Google Charts. However, recently I've become dissatisfied with its limitations, so I've decided to write and release my own QR encoder. I'm still looking for a catchy name for it (suggestions welcomed) - so for now it's called "QR Generator PHP". It's available…

Calibre PHP Patches

by @edent | , , , | Read ~133 times.

Two quick patches which should be in the next version of Calibre PHP. Adding File Size This shows the sizes of the eBook files. Screenshot shows a demonstration using the free "Hacking The BBC" eBook.

Installing Calibre PHP

by @edent | , , , , , | Read ~2,017 times.

(These are mostly notes to myself!) I love Calibre, it's the perfect eBook management tool. It comes with a built in WWW server so you can easily access your library on the go. The only problem is that this really only works if you have a single machine dedicated to Calibre. For various reasons, I…