In defence of deterministic password managers

If there’s one thing two decades on the internet has taught me, it’s that techies enjoy binary battles between opposing and equivalent technologies.

iOS vs Android. Vi vs Emacs. Tabs vs spaces. Didactic and fundamentalist exposition is kind of the norm when it comes to these discussions.

One topic I had not expected to see alongside these traditional battlegrounds is the nature of the tool one uses to manage distinct passwords across web sites. Until now.

Continue reading

Multi-threaded quicksort! In PHP!

Yeah! In PHP!

Why would you do this?

Well, I went to a PHP meetup presenting some common implementations and comparing them to the speedy native PHP implementation of sort() and related functions.

I figured that while efficient sorting isn’t the most common use case for PHP – and in a web context you often don’t want to let each user spin up numerous threads – for command line cases this approach should be able to provide a real performance boost.

In particular, the already-PHP-favoured quicksort algorithm works with a divide and conquer approach that should be perfectly suited to divvying up work between threads.

Continue reading

Twig cache permissions for Apache + cron on CentOS

I probably should have seen this coming, but when introducing Twig to a non-Symfony project, it hadn’t occurred to me to expect the same permissions dance that Symfony cover helpfully in their setup guide.

Having built a shiny new system that uses the same template cache for web requests (handled by the Apache user) and emailed reports (handled by another user via cron / command-line invocation), of course I hit exactly the same problem that those steps avoid. If you share any templates across the two users’ remits, eventually one will want to write to an existing cache file generated by the other user. It won’t have write permission, and Twig will freak out:

Continue reading

Facebook + Cordova + AngularJS encapsulation is no more?

Just a quick update following my previous post about using this Cordova Facebook plugin neatly with Cordova & AngularJS: unfortunately it seems EasyFB no longer supports the plugin because the plugin’s creators have decided to change the API and drop the previous transparent compatibility with Facebook’s JS SDK.
Continue reading

Phonegap, AngularJS & Facebook fun!

Update 6 August 2014: If you want to use up-to-date plugins, please beware the EasyFB approach isn’t going to work any more, so you might not get much out of this post. 🙁

I thought that getting Phonegap, AngularJS and Facebook working together couldn’t be a big jump from the simple quickstart guides available for each of those components. This was probably naïve.

It’s a nightmare

If any part of the above are new to you, starting out can be confusing and poorly documented. If, like me, you’re a newbie with both Phonegap and Angular… it’s worse.

Perhaps it’s because most of the constituent parts are changing so fast at the moment – despite myriad posts out there on each of the technologies involved, it took me absolutely ages to get it all working as I wanted, and even longer to replicate the steps reliably enough to write this!

As I never really found an article or post with my exact goals and a full explanation all in one place, hopefully this one might make the process less of a time sink for anyone taking the same route.

Continue reading