Glitch Run

Glitch Run

Glitch Run

On and off over the summer (admittedly much more off than on), I have been working on a little side project. Glitch the MMO closed down at the end of last year, but I was determined to get a little piece of it to live on. A few years ago, I build a small iPhone game for Tiny Speck as a demonstration of how to use the Glitch API and avatars in an iOS game. The code is all on github, but few people outside of Tiny Speck and the handful of developers who followed the developer blog ever saw it in action. It’s a very simple little running and jumping game, but it seemed a shame to just leave the game languishing, forgotten in a source repository, so I decided to resurrect it.
Continue reading

Jetpack Feedback Spam

Like many people, I use the Jetpack plugin to have a contact form on one of my sites. It’s  a nice thing to have there, even though nobody ever uses it. Well, at least I thought nobody was using it – I just ran a backup of the database and though it was taking rather longer than I expected. It turns out that I have actually been getting rather a lot of feedback, but all of it spam: tens of thousands of spam messages.

Now, the fact that the spam filters hid me from this is great – that’s exactly what they’re there for. But now they’ve built up and are taking up a large chunk of space in my database, I want rid of them. So, I set to. It turns out that’s not so straightforward.

Apparently, you can’t simply delete all your spam messages, you have to go through them a page at a time and move them into your trash. Once they’re in the trash, you can just click on the ‘Empty Trash’ button. Getting them into the trash however, was proving a little tedious.

The default number of items per page is 20. Trashing 20 at a time was going to prove slow progress. So, I upped the number per page to 500, still a lot of pages to get through, but should be faster. No such luck. Deleting 500 at a time results in a “URL too long error”. Good grief, have these people never heard of POST?

So, 100 items per page. Yes, that works, but boy is it tedious. After three pages I gave up. Can’t I just delete them from the database?

Yes, they’re all in the wp_posts table, and easy to identify. Except there’s a catch. They also have corresponding entries in the wp_postmeta table. That’s a bit more complicated to deal with. But then I realised, if I can just change them from ‘spam’ to ‘trash’ then I can get rid of them in one fell swoop with the ‘Empty Trash’ button. That will also then clean up all those loose ends in the wp_postmeta table.

So, one simple SQL statement is all I needed:

update wp_posts set post_status = 'trash' where
  post_status = 'spam' and post_type = 'feedback'

That finds all feedback items marked as spam, and moves them into the trash. Then, back over to the Feedback admin page and click on ‘Empty Trash’ and it’s all gone.

It really should have been easier than that though.

[Important: if you try this for yourself, do take a backup of your database first. Things always go wrong when you’re least prepared for them.]




Little Image Printer for iOS Released

Little Image Printer

Little Image Printer

It was rejected the first time through (they wanted to see a video demonstrating it in action), and then after resubmission it was stuck in the “In Review” stage for over a week, but, at last, Little Image Printer for iOS is finally available on the App Store. At its heart, it’s still the app that I built at the Little Printer Hack Day last month, but it’s been smartened up somewhat and padded out with a few more features. It’s a free download, so if you have access to a Little Printer, do try it out.

You can get it from the App Store here.

If you’re interested in seeing how it all works, the source code is also available on github.

Little Printer Hack Day

Yes, another post about Little Printer – he’s not the only thing I’m playing with at the moment, but he is one of the most interesting to blog about, so here goes…

Last Saturday, BERG organised their second Little Printer Hack Day down at their studio in London, and I went along to see what I could build. So, I dragged myself out of bed at some ridiculously unearthly hour and headed down to the big city.

The Hack Day itself was great fun. I won’t go into detail here, the folks at BERG have their own blog post about it which does it more justice that I’d ever manage; I’ll just say that I got to spend the day with a great bunch of people, who collectively had a whole load of amazing (and sometimes slightly crazy) ideas for things to build with Little Printer.

The real point of this post though, is to talk a little about the project I spent the Hack Day working on. A few weeks ago, I put together a small Mac app called Little Image Printer to send photos from your Mac direct to your Little Printer. This all worked pretty well, except for one thing: many of the photos I wanted to print were actually on my phone, and so I usually had to first sync them via DropBox or Photo Stream before I could actually see them on my Mac. This got a bit tedious. What I really wanted was Little Image Printer running directly on my iPhone.

So, that was my project for the day. Build a native iOS app to allow you to take photos, either via the camera, or from the Camera Roll, and send them to Little Printer. I had about five and a half hours coding time to get something up and running, and was rather pleased that it all worked out and my app was ready in time for the demos.

Little Image Printer for iOS

Little Image Printer for iOS

It’s a little rough around the edges – with a hard deadline like that, you sometimes have to cut a few corners, but overall I’m quite pleased with the way it all turned out.

I plan to continue to develop the app, and turn it into something a little more useful, and hopefully, before too long, submit it to the App Store so other people can easily try it out too.

In the meantime, I’ve decided to open source the code, and you can find that over on github. Currently, the code there is the version as produced on the Hack Day itself. I’ve been doing some more work on it though – I’ve already done a fair bit of tidying up and will be pushing an update later on today, and I’ll be keeping the repo updated with the various changes as I prepare Little Image Printer for the App Store.

If you have a Little Printer and you’re interested in trying out Little Image Printer for iOS, but don’t want to have to build and install it yourself, then I am looking for a small number of willing testers to help try things out. Places are strictly limited (thanks to the hard limit on development devices imposed by Apple), so please only ask to join in if you really are interested in testing and giving feedback. If you’re interested, do get in touch. You can email me as ‘dopiaza’ at this site’s domain, or find me on Twitter as @dopiaza.

Little Image Printer

So, I’ve been playing around with my Little Printer a bit more. One thing I’ve been wanting to do is print out photos and other images from my Mac. There’s no straightforward way to do that, so I started putting together a few scripts to help. Whilst the results weren’t too bad, some photos came out much better than others.

Printing photos on Little Printer can be a bit hit and miss. Sometimes you might need to tweak the contrast or brightness a little to get the best results, So, I figured it would be nice if I could put together a little UI to do that for me. And so, Little Image Printer was born.

Little Image Printout

Little Image Printout

It’s a native Mac app and requires OS X 10.7 or later. Read more about it and get a copy to try over on the Download page.