tmux

Posted: July 3rd, 2012 | Tags: , , | No Comments »

I’ve been meaning to move from the old standby of screen to tmux for the past getting an environment configured has been standing in the way: I’ve perfected my screen layout, and if I’m going to switch over, it needs to match. Everyone seems to accept that tmux has a more powerful/sane config language – and it does – but I’ve grown used to screen’s…eccentricities.

Read the rest of this entry »


Mock and Django

Posted: March 14th, 2012 | Tags: , , | No Comments »

I delivered this presentation on using the Mock library to the Toronto Django meetup. The slides should be pretty self-explanatory (once you hit slide #7 and are past the introduction); if not, check out the speaking notes.



SendGrid API tips

Posted: January 17th, 2012 | Tags: , , | No Comments »

I’ve recently been doing some work with SendGrid for sending transactional emails. They’re a great service, should be around for a while, and have super-friendly staff.

By and large, their API is well-documented. However in poking around and having various support chats, I’ve discovered the following under-documented things, some of which may be useful for someone else to know:


Movers

Posted: December 9th, 2011 | Tags: | No Comments »

Finding movers is tough.

Any time I need to move the same options get considered: do I do it myself, call one of the big moving companies, press my luck on Craigslist, send a message around and see who’s moved recently, etc. For my recent move from Ottawa to Toronto, I went for option two. After a big of searching, I ended up going with TriServices (based out of Ottawa) – and I’m happy to report they were great.

They kept in good contact with me in the run-up to moving day, packed and wrapped everything securely (major furniture only – I packed everything small into boxes myself), showed up exactly when they said they would, and charged me no more and no less than what their first email estimate said. Plus, both guys spoke excellent English, and answered their mobile phones eagerly when I would call and ask for an update (the answer was inevitably “everything’s on schedule”). In terms of movers, that’s pretty much my perfect list of behaviors right there.

If you need to move things from Ottawa to Toronto or around Ottawa, I would recommend these guys without hesitation.

For the record, I haven’t been paid for this endorsement (or been asked to write it) – consider this an attempt to help out the Internet hive-mind.


Custom DNS settings on a WIND Mobile stick

Posted: October 18th, 2011 | Tags: , | No Comments »

I’ve recently bought a Huawei E1691 mobile internet stick from WIND Mobile, to make up for not being able to install a TekSavvy line at my current apartment. The Speedtest.net results are nothing spectacular – 1.3Mb/s in an open-air café in downtown Toronto – but it’s more than usable for my basic internet needs. WIND’s default DNS servers, however, are…slow. I think we all know what this calls for: Google public DNS.

Read the rest of this entry »


Deploying from Git to WordPress SVN

Posted: July 29th, 2011 | Tags: , , | No Comments »

Do the following three things apply to you?

  1. You’re developing a WordPress plugin?
  2. You’re using github for your workflow?
  3. You’re looking for a simple, single-command way to deploy the newest version of your plugin to WordPress.org’s svn repository?

If so, look no more.

Read the rest of this entry »


Beaverton by night

Posted: July 26th, 2011 | Tags: , | No Comments »


Useful WordPress plugin snippets

Posted: July 23rd, 2011 | Tags: , , | No Comments »

In developing a WordPress plugin, I’ve been pleasantly surprised by the documentation. The codex is through, and links to the source code in the cases when it’s not deep. Having said there, there were a few snippets of code that took some searching to find and explain – common things that almost all plugins will (should) use, but weren’t obviously listed.

Read the rest of this entry »


Converting a dict to XML

Posted: April 18th, 2010 | Tags: | No Comments »

I was recently looking for a quick and easy way to convert a dict object into a corresponding XML fragment. For this particular use, there are no complex requirements; I’m only looking to use the key of each dictionary entry as the XML tag, and the value as its text. Using the excellent ElementTree library, this is both functional and somewhat Pythonic:

This function will work if you’re dealing with – as I was – a very simple dict. If your source object has anything more complex than strings or numbers as values, check out something more sophisticated like Pyxser.

from elementtree.ElementTree import Element, SubElement
def DictToXML(inp):
  i_root =  Element('item')
  for (field, val) in inp.iteritems():
    SubElement(i_root, field).text = val
  return i_root

Easy throwaway email addresses with Google Apps

Posted: November 10th, 2009 | Tags: , | No Comments »

When signing up for online services, I don’t like to use my real email address. While the vast majority of services are reputable nowadays, I don’t want to end up in a situation where Gmail’s spam filter is my inbox’s last line of defense. In order to make this usable, I have two requirements:

  1. Create specific email addresses for each service I sign up for, and make the connection obvious between the address and the service.
  2. Not do any extra work at point-of-signup.

I should be able to do this with Gmail’s plus-addressing, but most places don’t accept those emails as valid. Bearing that in mind, I have come up with the following solution, using Google Apps:

Read the rest of this entry »