Archive for JavaScript

Sweating the UI & UX details in Close.io: Emails & Email Addresses

My blog post on the Close.io blog was pretty popular (18,000 pageviews & lots of HN comments) so I wanted to cross-post it here:

Sweating the UI & UX details in Close.io: Emails & Email Addresses

We like to think of our sales software, Close.io, as having a lot of magic under the hood. When we do our jobs successfully, our users may not even notice, but their lives will be made a little easier. We try to make features just work without requiring users to think too much, even if that adds complexity in code.

Here are a few examples:

Read the rest of this entry »

End of 2012 Review

At the end of a year I like looking back and seeing what I’ve accomplished and what new technologies I started working with in the year. Here’s a little summary.

Read the rest of this entry »

How to unit test AJAX Requests with QUnit and Sinon.JS

We write QUnit tests for Close.io, a big Backbone.js app, to help avoid introducing bugs. Pretty quickly when testing front-end JavaScript code you’ll have to deal with how to test asynchronous callbacks and especially code related to AJAX/XHR requests and how their responses are handled. Here are some basic examples of how to use Sinon.JS to handle this.
Read the rest of this entry »

How to allow direct file uploads from JavaScript to Amazon S3 signed by Python

On Close.io we originally implemented Filepicker.io to allow for file uploads while sending emails. While it was a quick way to get started with file uploading initially, after several minutes of downtime of their API and then an unannounced change in their JSON response format, I was reminded once again that you shouldn’t to rely on small startups for critical parts of your tech infrastructure.

There’s nothing wrong with filepicker.io if you want to use a lot of their features, but in our case we just needed to allow simple uploading of files to our own AWS S3 bucket. Here’s how:
Read the rest of this entry »

Uploading static assets (CSS/JS) to S3 for CloudFront CDN

For a new Backbone.js + Flask project I’m using grunt + grunt-contrib, RequireJS’s r.js, Flask-Assets / webassets for static file (LESS/CSS, JS) compilation. But I needed a good way to get my nicely optimized static files onto a CDN and serving proper HTTP headers.

Using the excellent s3cmd tool, here’s what I came up with.

This example will break for browsers/proxies that don’t support gzip, but this is fine for my needs. Any other solution would either require a custom origin web server or writing different filenames in HTML depending on the request coming in. But since I want to use S3 as my origin this is the easiest/simplest solution.

Since all assets are “built” with a md5 version number hash in the file name, I want far futures headers to cache permanently.

Two Years at Quizlet

The last two years (2010-2011) I spent working at Quizlet were an incredible learning experience.

Like I did in Jan 2010, I wanted to reflect on some of the technologies I learned and things I did over the last 2 years…

Read the rest of this entry »

Behind the scenes look at my work at Quizlet

I just wrote a pretty in-depth article on the Quizlet Blog: “How We Do Product Development at Quizlet: An Inside Look at the Making of Speller” which describes the process of how Andrew and I created “Speller”, the latest study mode on Quizlet.

…a behind the scenes look at how we created Speller, our engineering challenges and processes, and how we obsessed over the user experience and the educational experience.

Includes some technical details of how we programmed it (mostly JavaScript), the text-to-speech, development process and usability testing, and lots of screenshots of the different iterations we did in order to get the UI right.

It’s a little long, but hopefully worth the read!

Book Review: “jQuery 1.3 with PHP”

I was given another book to review, called “jQuery 1.3 with PHP”, so here it is.  The book is aimed at beginners or intermediate developers wanting to learn how to “enhance your PHP applications by increasing their responsiveness through jQuery and its plugins“.

Read the rest of this entry »

Greasemonkey script: Facebook Reorder Sidebar

Hate scrolling down to see birthdays on Facebook? I just wrote a quick user script to reorder the parts in the sidebar on Facebook’s homepage.

Before: Requests, Suggestions, Sponsored, Highlights, Events/Birthdays, Connect
After: Requests, Events/Birthdays, Suggestions, Highlights, Sponsored, Connect

Read the rest of this entry »

Notes from Google I/O Keynote 2009, day 1

Google I/O Keynote

Wednesday 5/27/2009

San Francisco, CA #io2009

Read the rest of this entry »

Yahoo! User Interface (YUI) JS Libraries updates released

Some exciting news for front-end developers today: The Yahoo! Developer Network has released the newest version of it’s YUI JavaScript libraries today. With extensive documentation, great support for cross-browser coding, and a couple new components, these tools are becoming an even better solution for JavaScript developers. Check out more at the official YUI blog. Here is what’s new:

Read the rest of this entry »