Building OS X Apps with JavaScript

OS X Yosemite introduced JavaScript for Automation. This makes it possible to access native OS X frameworks with JavaScript.


The result above can be built using this code:


var styleMask = $.NSTitledWindowMask | $.NSClosableWindowMask | $.NSMiniaturizableWindowMask;
var windowHeight = 85;
var windowWidth = 600;
var ctrlsHeight = 80;
var minWidth = 400;
var minHeight = 340;
var window = $.NSWindow.alloc.initWithContentRectStyleMaskBackingDefer(
  $.NSMakeRect(0, 0, windowWidth, windowHeight),

var textFieldLabel = $.NSTextField.alloc.initWithFrame($.NSMakeRect(25, (windowHeight - 40), 200, 24));
textFieldLabel.stringValue = "Image: (jpg, png, or gif)";
textFieldLabel.drawsBackground = false;
textFieldLabel.editable = false;
textFieldLabel.bezeled = false;
textFieldLabel.selectable = true;

var textField = $.NSTextField.alloc.initWithFrame($.NSMakeRect(25, (windowHeight - 60), 205, 24));
textField.editable = false;

var btn = $.NSButton.alloc.initWithFrame($.NSMakeRect(230, (windowHeight - 62), 150, 25));
btn.title = "Choose an Image...";
btn.bezelStyle = $.NSRoundedBezelStyle;
btn.buttonType = $.NSMomentaryLightButton;

window.title = "Choose and Display Image";

By the looks of if you’re writing Cocoa, in a JavaScript syntax. Reminds me of the fact that you can record Photoshop actions in either VBScript or JavaScript code … and even translate those to C#.

Building OS X Apps with JavaScript →

Elsewhere , , Leave a comment

Cubic Bezier Curves – Under the Hood

Because, math!

Elsewhere , , Leave a comment


GoPro Introduces HERO4: The Most Powerful GoPro Lineup, Ever →

Elsewhere , Leave a comment


Set your camera free. Set yourself free. The first flyable and wearable camera that captures you in the moment.

Fly Nixie →

Elsewhere , Leave a comment Vagrant Boxes

The Virtual Machine Images – VMs used for testing several versions of IE – are now also available as vagrant boxes. Here’s the list:

  • XP with IE6:
  • XP with IE8:
  • Vista with IE7:
  • Windows 7 with IE8:
  • Windows 7 with IE9:
  • Windows 7 with IE10:
  • Windows 7 with IE11:
  • Windows 8 with IE10:
  • Windows 8.1 with IE11:

Use it like one would normally add & init & up a box:

$ vagrant box add {title} {url}
$ vagrant init {title}
$ vagrant up


Elsewhere , , Leave a comment

Manual Camera for iPhone

Full independent control of Shutter, ISO, White Balance, Focus, Exposure Bracketing


Manual for iPhone →

Elsewhere , , , Leave a comment



In Computer Science, it can be hard to explain the difference between the easy and the virtually impossible


Elsewhere , Leave a comment

Sesame Street: Star S’Mores (Star Wars Parody)

Elsewhere , Leave a comment

cPanel mass delete forwarders

One of the things I miss in cPanel is a way to mass delete forwarders. With the current version of cPanel you need to click the delete link next to each forwarder. Above that you don’t actually delete that forwarder upon clicking, you are taken to a confirm page where you need to click “confirm” in order to actually delete it. Deleting 100 entries can therefore take up quite a lot of time.

To speed things up I’ve knocked up a little JavaScript which:

  1. Replaces all URLs that link to such a confirm page to link to the actual delete page.
  2. Opens up all those links one by one so that the e-mailaddresses actually get deleted.

Usage would be something like this:

  1. In cPanel, go to Forwarders
  2. Use the “search” field to limit the results shown.
  3. Run the script above in the Dev Tools. All addresses shown from the previous step will be deleted.

(You might need to allow popups in your browser for your cPanel URL though)

Elsewhere , , Leave a comment

Storing MD5 values

A common occurrence I have noticed in MySQL apps is that MD5 values are stored as 32 byte values rather than 16. Just to ‘rehash’, an MD5 value is a 16 byte hexadecimal value, typically used as a unique fixed-length signature of a string, useful for identifying unique strings or one-way encryption of passwords. The binary representation takes 16 bytes (e.g. BINARY(16)), though a human readable hexadecimal version takes twice as many (e.g. CHAR(32)).

Same goes for IPv4 address, which can be stored as UNSIGNED INT (4 bytes) instead of VARCHAR(16) (16 bytes)

Tip: Storing MD5 values →

Elsewhere , , Leave a comment