Adding Python to the OS X firewall

If you ever get the warning “Do you want the application “python” to accept incoming connections?” on OS X, then somebody on Stack Overflow has helpfully written some instructions to keep it quiet.

My current side project is a bookmarking app written in Flask, and I get this message every time the app restarts. It’s mildly annoying, and I’m glad to see the back of it.


Tidying up my 1Password

I’ve been creating online accounts for years, and saving them in 1Password, but everything was a bit scattered. I’d never stopped to organise or tidy up my database. I also had a lot of weak or duplicate passwords that I’d never changed.

Last week, I set about cleaning up my 1Password database. This was more than just changing some old passwords: it was a thorough and deep-level reorganisation.

Continue reading →

A Flask app for taking notes

This is a pretty good plaintext notes web app. I’d been looking for something to use to take notes at work, and I’ve been trying this for about a month. I think I’ll keep using it.

It has all the features I need: Markdown support, full text search, and it runs on Windows. As a bonus, because it’s open source, I can easily tweak it where I want. (Some features were added in later posts.)

Flask is a small web server framework for Python that I’ve been using for a couple of recent projects. I was considering rolling my own notes app, but this one is pretty good.


Adding checkboxes to lists

Matt Gemmell had an interesting idea this evening:

Thought of a useful Safari extension: change any UL/OL elements on the page into checkboxes, for when you’re working through a tutorial.
Matt Gemmell (@mattgemmell) Feb 12 2015 8:15 PM

I decided to see if it would be possible, and in doing so discovered how rusty I’ve become at JavaScript. This is simple enough that it can be done with a bookmarklet rather than a browser extension, and that’s what I’ve done here.

Drag this bookmark to your bookmarks bar:

Add checkboxes to lists

Simply click it once, and all the UL/OL elements will have their bullets replaced by checkboxes.

If you want a quick demo, click the link above and see what happens to the following lists:

An unordered list:

  • Bread
  • Milk
  • Eggs

An ordered list:

  1. Do the first step
  2. Then do the second step
  3. Finally, do the third step

I’ve given this light testing on the latest versions of Safari and Chrome on OS X, but that’s it. (Using this will also allow you to discover all the interesting ways in which lists are used for page layout, when they break.) This was just a bit of fun; I don’t expect it to be a perfect solution.

Continue reading →

Swift 1.2 improves the “let” keyword, and other improvements

Apple released Swift 1.2 today as part of the Xcode 6.3 beta. There are lots of big changes, but one that I particularly like:

let constants are now more powerful and consistent — The new rule is that a let constant must be initialized before use (like a var), and that it may only be initialized, not reassigned or mutated after initialization.

I’ve been trying Swift for about two months on a couple of academic exercises (like the Matasano Challenges and Project Euler). I was planning on writing up some of my thoughts, and the behaviour of the let keyword was going to be one of my complaints, but now that seems to have been fixed. Hooray!

In Swift 1.1, variables supported an “initialise now, assign later” model, whereas constants had to be assigned at the point of initialisation:

var x: String   // This is okay
x = "foo"

let y: String   // This is a compiler error
y = "bar"

The new changes mean that constants also support “initialise now, assign later”, and the above is legal code. The old behaviour never broke anything, but it was a mild annoyance that I hit pretty regularly. The change won’t radically change the way I use Swift, but it will make my code a little smoother.

I’m impressed with the way Swift is improving and evolving. I don’t think it’s ready to be used for production code, because it’s still changing in pretty significant ways, but it seems to be for the better. I’m looking forward to seeing what the first “stable” version of Swift looks like.


What went wrong at King’s Cross over Christmas?

There were highly publicised problems and delays at King’s Cross Station over the Christmas period, for the nebulous reasons of “engineering works”. But to their credit, about a fortnight ago, Network Rail published a full report about the disruption, explaining how the carefully planned works overran so badly.

The report goes into a lot of detail, and it’s well worth reading. But if you just want a high-level overview of the major problems, then this summary is the best that I’ve read so far.


Register to vote – GOV.UK

Given today’s news that people are falling through the cracks in the Electoral Register, I thought try to spread the link for registering to vote. I did it this morning, and it took about five minutes. Really easy.

On a side note, I’m continually impressed with the design of the GOV.UK site. It has a very crisp and clean look, and the New Transport typeface gives it a distinctive feel. It’s probably one of the best-designed sites I use on a (semi-)regular basis.


Empire’s BBFC Ratings Podcast Special

In an Empire Podcast first, readers posed their Twitter questions, queries and grievances about movie ratings direct to the man who oversees them on a daily basis, BBFC [British Board of Film Classification] executive director David Austin. Why was Gremlins rated 15? What ever happened to What Ever Happened To Baby Jane?‘s 18 rating? What’s a 12A for, anyway? And what happened with A Good Day To Die Hard?

I thought this was a fascinating podcast about how the BBFC works: how they decide on a film’s rating, the way they choose the criteria for each rating, and changing attitudes towards adult content in films. It’s a very candid interview: Austin answers all of the questions head-on, in a very honest and reasonable way.

If you have any interest in film or cinema, then I think it’s definitely worth a listen.


RSS linkposts in Pelican

You may have noticed that linkposts have started appearing on the blog. This is, of course, not an original idea.

I use Pelican to generate the site, so I needed to find a linked list implementation that worked in Pelican. I started with Gabe Weatherhead’s post which explained how to add a link attribute to my Markdown source files, and I modified my templates and CSS for the linkposts. But Gabe’s post ended on a loose thread, which I felt compelled to pull on:

I’m still trying to understand how to create RSS feed link-style articles.

In most RSS feeds with linked lists, the main URL points to the original source, not the commentary on the host site. That’s what I wanted to implement in Pelican. (I don’t know if Gabe ever found the answer, but if he did, I can’t find where he wrote about it. I was also unable to find anybody else who’d done this before.)

Continue reading →

A script for exporting from iMessage

I have a bit of a love-hate relationship with iMessage. It’s the main way I talk to my long-distance girlfriend (along with Skype and FaceTime), but it’s also pretty buggy. Messages arrive multiple times, out-of-order, or not at all. But it’s convenient, so I keep using it.

The iOS and OS X Messages app both use SQL databases to store their data (sms.db and chat.db, respectively). I sometimes worry about losing the messages in an iOS update, or database corruption, so I wanted to get my messages out of SQL and into a plaintext format. I’ve started writing a script that takes the SQL files, and exports each thread as a JSON file.

The script, and all my notes, are in a GitHub repo. This includes the database schema used by Messages, and some references/useful pointers on edge cases I’ve run into. Still a work-in-progress, but hopefully useful to somebody.

Copyright © 2012–15 Alex Chan. Built using Pelican. Privacy policy.