SublimeGit or GitGutter stopped working? Here’s why.

This week my dev productivity dropped for a day. And I hated it.

Two of my favourite plugins for Sublime Text are GitGutter and SublimeGit. The former lets me see what I’ve changed in the current branch easily, and the latter lets me easily check in code, run “blame”, etc.

They suddenly stopped working. I had no idea why. GitGutter stopped showing anything, and SublimeGit told me I wasn’t even in a folder managed by git.

Yet command line git worked just fine. Infuriating.

I re-installed both. No joy.

I re-installed SublimeText. No joy.

I downgraded from Sublime Text 3 (beta) to v2. No joy.

I was seriously tearing my hair out.

I finally came across the solution and reason purely by accident. I had to upgrade a module that required a compiler and it failed because I had a new version of xcode and the command line tools – they needed me to accept the license via the command:

sudo xcodebuild -license

Once run, that fixed GitGutter and SublimeGit.

The reason? I had git from homebrew installed. The plugins in Sublime Text used the OS X version of git instead, which wouldn’t run without accepting the license.

I’m not sure this is entirely OK. Should I have to accept a license for non-Apple software when re-installing the command line tools? It seems wrong to me. Thoughts?


The Brain Is Not Setup for the Netflix Model

I love Netflix. For my $9 a month I get access to great content, without ads, whenever I want it. I’m happy to admit that watching TV isn’t the greatest thing to do with my time, but frankly screw you – I enjoy it. A bit of mindless entertainment after a day of thinking about Angular Controllers and SQL calls is a nice break for me.

But I’m not convinced Netflix’s model for new TV shows is right.

Netflix is now producing some truly fantastic new content, only available to subscribers (modulo piracy):

  • Orange is the New Black
  • House of Cards
  • Narcos
  • Daredevil
  • and many more

They release it under the same model they release all their TV content: All episodes available at once.

I’ve discussed with coworkers and friends the first problem with this: It prevents the watercooler discussions. It’s impossible to know what episode someone is on without asking them, and so assuming you’re a polite person you don’t want to introduce spoilers into the discussion, so you just don’t talk about it until everyone is done the entire season. But regardless, that’s not what I want to discuss.

What I think is interesting, is if you ask a coworker what their favourite episode or favourite scene in Game of Thrones was, it is easy for them to answer (assuming they watched it). If you ask the same coworker what their favourite episode/scene was in Narcos (which was an amazing series, I highly recommend it), it’s a much more difficult question to answer.

I wonder if this is related to the fact that the brain creates long term memories in very strange ways, and because binge watching a TV show creates so many short term memories muddled into one, we can’t generally remember specific episodes or scenes very well – it becomes one big muddle.

I still hope that some day Netflix experiments with releasing a “Netflix Original” the old-school way. Just to see if people prefer it on some level.


The Problem With Ahmed’s Clock

Hopefully most readers of this blog will know of the case of Ahmed Mohamed who brought a home-made clock to school, and was taken into custody and interrogated for the appearance of this electronic device.

This has caused uproar in the geek community, and even resulted in Cmdr Hadfield tweeting an invite to a talk in Toronto, and even an invite from President Obama to visit the whitehouse.

Now, let’s first visit the issue at hand – at first I was outraged at the situation, then I saw the clock, and thought “Well that does kinda look dodgy”. Let’s see the picture the police posted:


I mean, it does look like a bomb you might see in a movie. But then you look closer, and realise that a) the LED display points outwards, and b) it’s actually a pencil case, not a metal suitcase:


This softened my feelings significantly. I mean, it’s a freaking pencil case, not a metal suitcase. I’m pretty sure I had 25 pencil cases in school that I hacked up into all kinds of messed up things for other uses. Sorry, Mum.

But it’s all beside the point. The problem comes down to one word alone:


I don’t really know if it’s since 9/11, or if that’s just when my awareness of this change started to peak, but there’s a huge problem in our feelings that needs to be addressed.

Adults in the western world now fear everything. And it has to fucking stop.

We coddle children, and it’s stupid. When I was 7 years old I was riding my bike to school, about a mile away. Alone. Nothing ever happened to me. By 11 I was cycling to school 4 miles away. I thank my parents for that freedom so much – they absolutely did the right thing letting me do that.

Nothing happens to children today, either. We hear about extremely rare cases of child abduction (which are almost never conducted by strangers) far more often than we did in years ago due to 24 hour news channels and the internet. Crime continues to decline year on year, and yet our fear of it continues to rise.


The fear needs to stop. It’s just so illogical and dumb.

Ahmed is not alone

Ahmed is far from alone in the U.S. Many have made this a race issue, but while it may have had some racial aspects due to the “bomb” issue, it is really a problem with how the people are afraid, and pass far too many issues off to law enforcement these days. Hundreds of children in North America are now taken into custody by police every year.

I suspect, if I were in school today, I would also be taken into custody. Hell, I remember blowing up capacitors (after being demonstrated how to do it by our “cool” electronics teacher) in the science lab, and I suspect that today would be an offence.

Adults everywhere need to stop, and take stock of what they have done to themselves. These are kids – they are going to push boundaries, play with things, explore, hurt themselves, challenge your rules, break stupid laws, and scare you half to death. But they are kids. They are our future. Let them explore!

Think about how you played as you grew up – you did probably much worse. And here you are.


The Sales Process is Hard

I was recently involved in a sales call at Ideal Candidate with a company run by a couple of old friends of mine. While I was comfortable asking their help to setup the initial call, I am not the kind of person to abuse that relationship to push a sale – I’d much rather their company see the value proposition in our product.

Unfortunately on the sales call I probably talked too much – I am after all, a technologist. I am hugely enthusiastic about our technology and our science. But that doesn’t explain the actual value our our product.

I’ve been thinking about this since the call. We are basically a recruiter. But we really have two major differences:

  1. We’re massively cheaper. For less than 1/5 of the price of a recruiter for a single hire, you can hire as many people as you need, albeit you have to pay us every month (*).
  2. Rather than scanning resumes/CVs for a match, we use proven science in the field of sales to find people who will actually succeed in your company, from a database of salespeople we have already built, and who have already taken our personality assessment (used in the matching process). This is really hard to explain in either a blog post or a 30 minute call, but there is plenty of well proven research out there showing this science works.

Unfortunately I focussed on the science behind point 2, and missed telling the person on the call about value – the fact that we provide the candidates to them, and these are candidates which are already scientifically assessed to perform well in the department being hired for.

What I’m astonished by at Ideal Candidate is the amount of work we can do for a company for this price. We provide pre-matched candidates. We phone screen for you. We set up and book interviews for you. If I had this service for this price (about double the cost of a job post on LinkedIn), for hiring developers, I would love it. Unfortunately the science works differently for developers (but some day we’ll probably work on it).

But damn, it’s hard to persuade people that the technology is sound, and we’re actually going to save you money. Our sales guys have to be really persistent, and I’m very thankful that they are. Good luck to them!

* – if you’re hiring in sales, and the salesperson performs, then the more salespeople you hire, the more money your company makes, so even if this seems a little odd for hiring in a development (which most of my followers are), in sales it makes a lot of sense for sales.


Announcing Haraka 2.6.1

The Haraka development team is proud to announce the release of v2.6.1 of the popular mail server, Haraka.

This release adds some small new features, but is mostly a bug fix release for the 2.6 series. In particular a bug in mail_from.is_resolvable was fixed which can cause Haraka to crash.

Other changes in this release:

  • added sedation timers for config file re-reading
  • Add AUTH support to outbound
  • tests/spf: quiet excessive DEBUG noise
  • allow domains with underscore
  • correct name of domains config file in access
  • Fix SMTP AUTH in smtp_forward/proxy and add docs
  • Fix opts not being passed to HMailItem _bounce function
  • log.syslog will try strong-fork-syslog (for node 0.12 compat)
  • improvements to Plugin docs
  • rename net_utils.is_rfc1918 -> is_private_ip
    • IPv6 compat
    • test coverage
    • add IPv6 unique local fc00::/7
  • pre-populated config/plugins
  • added utils.extend, copies props onto objects

Upgrading for most users should be as simple as running “npm install -g Haraka”, and copying over the files “extra-tlds”, “top-level-tlds”, “three-level-tlds”, “two-level-tlds” and “public-suffix-list”.

Enjoy, and for any issues please use github issues or join us on #haraka on irc.freenode.net


Announcing Haraka v2.6.0

With thanks to a ton of hard work from the Haraka development team I’m very proud to announce the release of Haraka v2.6.0.

This release is the culmination of a huge number of patches and changes, so please check your configuration carefully when upgrading.
The following is the full list of changes in this release:
* other bug fixes
* updated a few tests so test suite passes on Windows
* log.syslog: handle failure to load node-syslog
* plugin directory is $ENV definable (@martin1yness)
* logging timestamps were static, fixed by @cloudbuy
* queue/rabbitmq_amqplib, new plugin for RabbitMQ using amqplib (@esevece)
* outbound:
    * plugins can set the outbound IP (during get_mx)
    * only replace line endings if not \r\n
    * bannering fixes
    * added support for per recipient routes
* tls: don’t register hooks upless certs exist
* removed contrib/geolite-mirror-simple.pl (replaced by
  docs update pointing to maxmind-geolite-mirror)
* rcpt.routes: new plugin by @msimerson
* make haproxy IPv6 compatible
* record_envelope_addresses: new plugin by @deburau
* prevent_credential_leaks: new plugin by @smfreegard
* config:
    * configfile: added .yaml support
    * improved config file ‘watch’ logic
    * Allow hyphens in params in config files (@abhas)
    * cached requests include options in cache key name
* asn: updates for node 0.11 compat
* dnsbl: use aysync.each vs forEach (avoid race condition)
* spamassassin: improved config loading and test coverage
* geoip: deprecate geoip-lite in favor of maxmind, IPv6 compatible
* disable SSLv3 (due to POODLE)
* dkim & spf, updates for node 0.11 compatibiilty
* karma: move neighbor scoring from code to karma.ini
    * move excludes list to karma.ini
    * apply awards before adding message header & permit rejection at queue
    * karma.ini: score updates for access & uribl plugins
    * score denials issued by skipped plugins
    * add scores for specific DNSBLs
* add transaction body filters (@chazomaticus)
    * change bannering to use them
* helo.checks: fix timeout bug
    * match_re now validates and pre-compiles all REs
    * Add new proto_mismatch check
* p0f: add register(), load config once, early
* server: improved config handling
* data.headers: add Delivered-To check
* rcpt_to.ldap: new plugin by @abhas
* smtp_client: only load tls_* when cfg.enable_tls
* added plugins/host_list_base
* Platform independent temp dir (thanks @martinvd)
* move deprecated docs into docs/deprecated
* Switch to Phusion baseimage instead of stock Ubuntu (thanks @Synchro)
* dkim_verify: new plugin by @smfreegard
* many new tests
* improved URI parser (for URIBL plugin)
* Allow mixed case STARTTLS command
* Install Node via package manager (Mohd Rozi)
* Fix a couple crit errors (@Illirgway)
* Add noisy/bulk out-of-band rule support to MessaageSniffer plugin
* initial support for rabbitmq plugin (@samuelharden)
* bounce, added non_local_msgid checks and much faster lookups
* vpopmail: fail faster during a CRAM-MD5 auth attempt with an invalid user
* fcrdns: handle a null hostname
* Improve HAProxy support code and documentation
* tls: reworked for efficiency and linear style
* access: test hostname validity before PSL lookup
    * load lists into objects (vs arrays), for much faster runtime access
* host_list: huge performance increase, esp for many hosts
Documentation is up to date on http://haraka.github.com/ where you can read more about the many changes in there.
This release has been tested on Node v0.10 and v0.12 and IO.js. It should work on Node v0.8 but we do not recommend it.
Thanks for your continued support of Haraka.

Solving the express ‘array of routes’ problem

Today on hacker news people have been discussing an issue Netflix had with a bug in their route reload code using Express. Now in express, routes aren’t meant to be reloaded (and there are plenty of options for restarting without stopping accepting connections – I’ve even written a simple one myself), but they hacked it in anyway, and every reload resulted in the processing of routes slowing down.

The discussion on hacker news didn’t focus on the actual problem Netflix had, more on the issue that express uses a simple (recursive) loop through an array of routes to find the appropriate route for the request, continuing on to the next matching route if next() is called.

While this isn’t a problem for our systems at work, some people in the discussion and elsewhere said there’s no way to solve this without breaking the semantics of how express currently works (routes have a defined order, and multiple routes can match a single request). Suggestions of a path-based DFA were quickly rebutted.

However that’s a naive way to solve the problem.

V8 has a very fast regular expression engine that compiles regular expressions to x86 machine code. This could be exploited to implement the current routing logic using a large single regular expression (actually N regular expressions, where N is the number of routes, but I’ll come to that).

The implementation is very simple:

  • Take each route (which can be a string, a simplified regexp, or a full regexp) and convert it to a regexp (presumably the router already does this internally because /foo/:id has to match any value for :id).
  • Combine the regexps with bracket matches and alternation: ((re1)|(re2)|(re3)|(re4)|(re5))
  • Generate N regexps, depending on number of routes: ((re1)|(re2)|(re3)|(re4)|(re5)) and ((re2)|(re3)|(re4)|(re5)) and ((re3)| (re4)|(re5)) and ((re4)|(re5)) and ((re5))
  • When a request comes in, check the first regexp, if it matches, you know which alternation matched based on the return from RegExp.prototype.exec(), from there you pick the route function based on an index in an array of route functions.
  • Alternating regexps match in order so this preserves the Express semantics.
  • If next() is called, you go to the next regexp in the list (e.g. ((re2)|(re3)|(re4)|(re5))), and run that. Use the same algorithm (with index + 1) to find the appropriate route function.

This solves the performance problem because the V8 regexp engine finds the appropriate route extremely quickly, and keeps the Express ordering and multiple routes semantics in-tact.

I haven’t proved this is any faster yet, I’m just assuming. I suspect not much for small numbers of routes, and I don’t know if the JS engine has size limits that would prevent it working on large numbers of routes.

Also, this is just an idea I had – I welcome people telling me why it couldn’t work as perhaps my understanding of the Express internals isn’t as strong as I hoped.