Javascript

13 Nov 2011

I was working through a tutorial on Bogart and CouchDB and decided to implement the examples in CoffeeScript instead of JavaScript as I've been meaning to play with CoffeeScript for a while now.

One of the files in the tutorial is the package.json file for managing dependencies in the (absolutely lovely) package manager npm. When I wrote the data structure out in CoffeeScript, however, the compiled data structure wasn't valid JSON according to JSONLint (it was nested between parentheses, had unquoted keys, and a trailing semi-colon, as you can see in the code snippet.) (more...)

A simple CoffeeScript to JSON shell script for Macs

If you're as lazy as I am, you might want to write out your static data structures in CoffeeScript instead of JSON. This little script lets you convert a file containing a CoffeeScript data structure to valid JSON.

11 Oct 2011

So what do you do if you lose a public battle to change the face of JavaScript?

If you're Google, you decide to go it alone, implement what you want to anyway, and then tell the world that it is going to replace JavaScript.

(more...)

Google Dart, or ‘how we lost the ECMAScript 4 battle so we decided to create our own language instead’.

Introducing Dart, Google's second shot at ECMAScript 4.

25 Jun 2011

File this under Ultra-Niche. If you happen to be one of the three people in the world using Adobe's easy-to-use and powerful ExtendScript to script the CS*-series of tools (e.g., Photoshop) and you're using the FIle object to write out files manually, read on.

Under Snow Leopard, the following code would work (you'll find variants of this code floating around the Internets):

(more...)

Adobe ExtendScript File object gotcha under OS X Lion

The File object behaves differently in ExtendScript under OS X Lion.

4 Jun 2011

Extendscript editor
In the initial version of the upcoming Update conference web site, I'm optimizing for desktop, iPad, and iPhone-tier phones. This means that I have to create five different versions of nearly every image. One for the desktop size, one for 320px wide screens, one for 480px wide screens, and two for the Retina (@2X) resolutions. Of course, saving all those images by hand would suck. And it's not enough just to resize the images and export them for web since, when resized, I need to unsharp mask them to make sure they're not blurry.

I initially thought I could record an action to do this, but the Photoshop file I have for the graphics has dozens of layers. I thought I could use the Layer comps to files… script that ships with Photoshop but – while it let me export layer comps to files – it wouldn't let me add custom actions in the middle of the process (in this case to unsharp mask the image once it was resized).

(more...)

Multi-resolution images, Photoshop, and ExtendScript

Using ExtendScript and Photoshop to make it easier to build multi-resolution images for web sites.

24 Jan 2011

Geek Ninja Factory Battle night

Update: sorry everyone, the event sold out in under 24 hours but there is a waiting list you can sign up to in case anyone drops out. Thank-you all for your overwhelming interest and here's looking forward to seeing a bunch of you there in March!

(more...)

READY? FIGHT! Don’t miss the first Geek Ninja Battle Night!

Andy Clarke and Remy Sharp square off against Sarah Parmenter and yours truly in a battle of wits as we explore Mobile: Web vs. Native.