Post categories




How to import your ReadItLater items into Delicious (python converter)

I like readitlater; but recently I found myself wanting to share some of my tagged items with other people and couldn’t find a way to do it. I used Delicious years ago and that’s always been a much more social app, so fired that up, and looked for way to import items.

Unfortunately the export format of readitlater isn’t compatible with the import format required by Delicious; so here’s a quick python script to convert a ReadItLater exported html file to a file that Delicious’s import will accept.

(more…)

Google Chrome Extension build script

If you build Chrome extensions, you probably understand it’s a bit of a pain in the bum having to move all the files into the right place (especially if you have shared assets elsewhere), keep track of versions of your package, update your update.xml, and packaging it all up into a .crx and a .zip for publishing on the Chrome webstore. I found a it a pain in the bum anyway, so I wrote a bash script to simplify the build process a bit.

It pumps out a .crx (signed with your .pem, ready for hosting on your site) and a .zip (ready for uploading to the Chrome Store).

(more…)

Download Google Music tracks with wget from Chrome

Google Music (or Google Play Music now!) is brilliant. It lets you upload 20,000 tracks to Google’s servers, available to play anywhere with a web browser, and streamable from your phone too.

However, sometimes it’s good to be able to listen to your music when you haven’t got an internet connection – the Android Music client supports “make available offline” for tracks, but the webpage doesn’t yet – so I wrote a small Chrome extension that generates a list of wget commands (and mv commands) to automate the process of downloading specific tracks from Google Music, ready for play offline.

(more…)

A raytracer for Google Chrome Native Client

A couple of months ago, I applied for a job. I’d been working for the previous 6 years in Java, and the job was a C++ post so I needed to learn C++ quickly – as a good project to get me going, I wrote a raytracer. I got the job, and I’m about 5 months in – looking back at the code I’d written for this starter project, it’s not great – I’ve already learnt a lot in that time, so I’ve rewritten it – and this time I targeted only standard, portable C++ so it compiled nicely (at least the core of the raytracer does) under GCC 4 with no libraries on any platform I fancied.

Then I found out about NaCl - Native Client – Google’s system for building extensions for Chrome using native code – and noticed the requirements for building things in it are that it compiles in GCC 4. Sounded like a good test-case…

(more…)

Free cross-platform dynamic DNS with wildcards

This will roughly explain how to get wildcard DNS working for free (any-words-here.yoursubdomain.yourdomain.com) on a connection which gets assigned dynamic IPs. I’d like to make sure subdomain.example.com is always up to date with my home IP, and be able to request subdomains (like someword.subdomain.example.com) that resolve to the same IP. These are useful if you want to use multiple virtual hosts in apache hosted from a machine on your home network, accessible to the outside world using a fixed hostname.

(more…)

VIM quick fix (for arrow keys in insert mode)

When using VIM in insert mode, when I try and move around with the arrow keys, it inserts A, B, C and D instead. Not completely sure why, but typing:

:set nocompatible

seems to fix the problem. You can make this permanent by sticking

set nocompatible

in .vimrc in your home directory. Anyone know why?!

How to create pages outside of the WordPress installation, that use WordPress themes

This is a quick guide on how to get  a file anywhere in your webhost’s file tree to serve its content as if it was part of WordPress – this can be useful if you already have a site that you only want to use WordPress for part of, or if you have WordPress that is installed in a subdirectory separate from the rest of your site, but you want to “export” a bit of it elsewhere.

(more…)

Let Firefox read local files during development

Use with caution!!

By default, Firefox doesn’t allow resources on the web to access local files. However, when debugging a web application, this is sometimes useful (for example, if you have a remote web system that takes a long time to rebuild/update, and want to make a lot of small trial-and-error changes to javascript/css). This is potentially very dangerous, so only enable whilst you’re debugging, and turn off when you’re done :)

(more…)

Random dev doodling – JavaScript 3D cube

Being a developer, I spend quite a bit of time playing around with programming bits and bobs. A little while ago, I had a relatively old Nokia that supported J2ME (without floating point) so I decided to try and write a simple 3d renderer for it – having no FPU (floating point unit) I had to write an integer math library, and sine/cosine lookup tables against the math library. This was all good stuff, and reminded me some of the maths I learnt at uni, and some good optimization tricks.

A couple of months after that, bored one afternoon, I decided to write something similar in JavaScript – modern browsers have decent JavaScript engines with good floating point support, so it was a lot easier… after proving that it could be done, I lost interest, but here’s where it go to.

(more…)

Quick howto: init.d script for glassfish 3

Glassfish is a reference implentation of the Java EE 6 application server – it’s fairly easy to download and get running, but I wanted to get it running automatically on system startup on my linux server (which at the moment is running on coLinux – probably post about separately that at some point).

I’m assuming you’ve got the glassfish .zip, and extracted it to /opt/glassfishv3… and you’re running a debian-based OS (like Debian Lenny, or Ubuntu). These commands assume you’re either running as root, or prepend all of them with sudo…

(more…)