Alex MacCaw

by Alex MacCaw

JavaScript programmer, O'Reilly author.

Page 3


Speed up Heroku deploys

While building Monocle, I noticed that deploys to Heroku were taking absolutely ages; specifically the asset pre-compilation stage. I tried a variety of things, including removing a bunch of CoffeeScript files, but deploys were still taking in the order of several minutes.

After talking to Josh, it seems the solution is a simple one. Simply enable Memcache caching for sprockets during the pre-compilation stage. By doing this, I’ve reduced asset compilation from 100 seconds to between 4-9 seconds.

By default, each Heroku deploy is in a isolated environment. This means that Sprockets can’t take advantage of previous asset compilations, and has to compile everything from scratch. The solution is to have a shared cache between deploys.

If you’re using Heroku, the first step is enabling a Memcache addon. I’ve gone with the memcachier service, as they’ve got a generous free plan (which is...

Continue reading →


Monocle

I’ve been working on a project called Monocle these past few weeks, and it’s time to show it to the world.

Monocle is an experiment in creating a friendly and intelligent community around sharing quality content with a focus on technology, startups and frankly anything that appeals to the inquisitive mind.

Screen Shot 2013-07-03 at 12.05.36 PM.png

Philosophy

Over the next few weeks I’m going to be writing about the more interesting aspects to Monocle, but for now I want to talk about the motivations behind it.

The motivation for developing Monocle was to create a friendly and safe place for ideas and feedback. Criticism is kept to the constructive variety, and social accountability is provided by linking your Twitter or GitHub accounts.

There can be too much negativity in the tech community. It seems the average response to someone out on a limb, showcasing their latest idea or startup, is one of snark and derision. That...

Continue reading →


How to travel around the world for a year

While my last post covered my previous year traveling, writing and programming, this article will go into the specifics of planning your own round the world trip, including flights, costs, activities and accommodation. I’ll show you how affordable traveling actually is, and how to plan your own adventure.

“Travel is fatal to prejudice, bigotry, and narrow-mindedness.” - Mark Twain

I think it’s especially important for people to get out of the Silicon Valley echo chamber, to travel and get some perspective. Traveling opens your eyes to some of the real problems people face, and gives you the opportunity to come up with solutions to tackle those, rather than some of the more trivial ideas closer to home. You can’t fail to come away from traveling inspired with a fresh perspective and new ideas.

Stuck in Customs

Choosing where to go

Choosing where to go can be overwhelming at first, especially when...

Continue reading →


Traveling, Writing and Programming (2011)

In a nutshell, my year so far has consisted of:

  • Traveling for 10 months around the world through 17 countries covering Africa, South East Asia, Australasia and North, Central and South America. The trip was centered around surfing and photography

  • Presenting in Hong Kong, Japan, the US and London

  • Writing a book for O'Reilly as I went, titled JavaScript Web Applications

  • Writing another book on CoffeeScript, soon to be published by O'Reilly.

  • Doing a ton of open source libraries, such as Spine, Spine.Mobile, GFX, and Juggernaut.

  • Building a startup prototype

  • Presenting at FOWA

  • And finally, landing a job at Twitter

So, let me start a year ago, in September 2010. I had just left a startup I’d co-founded, and whilst the experience was useful, I was feeling bit burnt out from the incredibly long working hours involved. I was back in England and needed to make some decisions. A long held...

Continue reading →


Asynchronous UIs - the future of web user interfaces

It’s an interesting time to be working on the frontend now. We have new technologies such as HTML5, CSS3, Canvas and WebGL; all of which greatly increase the possibilities for web application development. The world is our oyster!

However, there’s also another trend I’ve noticed. Web developers are still stuck in the request/response mindset. I call it the ‘click and wait’ approach - where every UI interaction results in a delay before another interaction can be performed. That’s the process they’ve used their entire careers so it’s no wonder most developers are blinkered to the alternatives.

Speed matters; a lot. Or to be precise, perceived speed matters a lot. Speed is a critical and often neglected part of UI design, but it can make a huge difference to user experience, engagement and revenue.

  • Amazon: 100 ms of extra load time caused a 1% drop in sales (source: Greg Linden,...

Continue reading →


Chrome’s requestAutocomplete()

Another Google I/O, and another raft of awesome products. One announced API that I’m particularly excited about is requestAutocomplete(), a feature which is landing in Chrome Canary for Windows and Mobile (with OSX support coming shortly). What this API does, in a nutshell, is give you programatic access to autocomplete (or autofill) data.

Autocomplete was originally designed to make it quicker to fill out forms, but what if we could remove the forms altogether! Back in June I proposed just such an API - a way to programmatically retrieve autofill data stored in the browser. The proposal has evolved, improved, and is now going to be baked into future versions of Chrome.

1Zh85u4gzhhDkC6myiRAyO2SH1iRgCCbUoJ4O.png

What does it look like? Essentially it involves calling requestAutocomplete() on a form element. The form doesn’t necessarily need to be shown to the user, but the browser uses it to detect which input types to...

Continue reading →


Setting up Sublime Text 2

I recently decided it was finally time to part ways with TextMate, my trusty companion for these last few years, and start the hunt for a new editor. After a quick Twitter poll the unanimous advice was that I should try Sublime Text 2.

After a few weeks of using Sublime Text I can safely say that it’s the best editor I’ve used. It’s fast, extendable and hasn’t ever crashed on me. That said, that no editor is perfect and Sublime Text does require a fair bit of initial configuration.


After you’ve downloaded & installed the editor, the first step to configuring Sublime Text 2 is to install the package manager. I’m hoping in future versions of the editor this package manager will come bundled, but for now it requires a separate installation. Run Sublime Text, Press ctrl ` (control backtick) to open the editor’s console, and paste in the code listed here.

Once the manager is set up,...

Continue reading →


Analyzing my DNA

I recently bought 23andme, a service which requires you to send off a DNA sample, and in return performs a series of interesting tests concerning your health and ancestry. I bought the test as a birthday present to myself, somewhat because I was interested in the results, but also because I wanted to treat it as a catalyst for learning more about the subject.


The first step in the process of getting your DNA analyzed by 23andme, is to put a substantial amount of saliva into to a specialized container they mail you. This saliva contains cheek cells, which is what 23andme use for genotyping. They don’t need many cells, but the reason why they ask for so much saliva is so that it’s harder to take someone else’s DNA without their permission!

Then the DNA sample is mailed off to 23andme’s laboratory where it’s amplified through PCR, a process where the DNA is separated from the nucleus...

Continue reading →


Abba - JavaScript a/b testing

Abba is a self-hosted a/b testing framework built to help improve conversion rates on your site.

Tuning signup and payment forms can have huge effects on your business, and it’s a good idea to supplement design and copy changes with data on how differences actually effect conversion.

We built this tool for internal use at Stripe, and today we’re open-sourcing it for everyone. The key design goal of Abba is to have a great JavaScript API (unlike some of the other a/b testing services out there). For example:

<script src="//localhost:4050/v1/abba.js"></script> <script> Abba('test name') .control('test a', function(){ // Show test a $("#test-a").show(); $("#test-b").hide(); }) .variant('test b', function(){ // Show test b $("#test-b").show(); $("#test-a").hide(); }) .start(); </script> <script> $('button.complete').click(function(){ // Successful...

Continue reading →


Stripe Push Notifications

What’s the best kind of Push Notification? One that tells you you’ve made more money of course.

Stripe Push is a little side-project that sends you Apple Push Notifications whenever you get a new charge or transfer via Stripe.

Screen Shot 2013-02-08 at 12.33.56 PM.png

You can configure what type of notifications you want to receive and their frequency. I’ve open sourced the Sinatra and Mac app behind it on GitHub.

Get it from the Mac App Store.

Continue reading →