Posts

Using the new Windows 10 ssh client with TortoiseHg

After a little trial and error I got TortoiseHg to successfully use the ssh client that is now built into Windows 10. It's nice because it doesn't require conversion of your private key to ppk format - as plink required - so you can use a standard id_rsa file (easy if you're using *nix as well as Windows). It does not provide a GUI prompt for encrypted keys - it's looking to stdin for the password, which it will never receive, so unfortunately you'll need a plain-text private key. Put your decrypted private key in /Users/yourname/.ssh  and use the following command line in your TortoiseHg settings -> Sync -> SSH Command: C:\Windows\System32\OpenSSH\ssh.exe -2 I'm also exploring the use of the ssh-agent ... currently thwarted by the fact that this service simply won't run.

Using an Async Iterator in Typescript

I have been experimenting with async iterators in Typescript. One area these could be useful is in simplifying the code for forms, specifically handling button presses. Currently, I create forms programmatically using my form class, which creates Bootstrap modal forms. "Action buttons" are the buttons that sit in the modal-footer area. When creating "ActionButton"s to add to the form an onClick handler is specified and the form takes care of calling onClick() when the button is clicked. Here's a trivial example - an About box with an Ok button and second button just for testing. export function about(): void {   let aboutBox = new forms.Form( `About ${app.productName}` );   aboutBox.addButton(   {     name: 'Ok',     onClick: ()=>     {       aboutBox.close();     }   } );   aboutBox.addButton(   {     name: 'Test',     tooltip: 'Test some stuff',     onClick: ()=>     {       // do some stuff     }   });   aboutBox.show(); }

Windows FILETIME to Javascript Date

In case you ever care about this ... /**    * fileTimeToDate()    *    * Convert a Windows FILETIME to a Javascript Date    *    * @param {number} fileTime - the number of 100ns    * intervals since January 1, 1601 (UTC)    * @returns {Date}    **/   function fileTimeToDate( fileTime ) {    return new Date ( fileTime / 10000 - 11644473600000 );   };

How Corpse Bride was made.

Jonathan Lucas Unveils His Editing Secrets on 'Corpse Bride,' the First Stop-Motion Animation Feature. Previously the article was found here: http://www.editorsguild.com/newsletter/JulAug05/julaug05_bride.html However that link is dead - the article is now here: https://www.editorsguild.com/Magazine.cfm?ArticleID=110

Localised Date & Time in Javascript

I want to display a date & time string that's formatted correctly depending on the viewer's locale. Question: can I rely on the javascript Date object's locale-specific string functions ? Answer: yes, but only if I don't care what it looks like or how many characters are in the string. Here's the result of my testing: toLocaleString() FF15:     "Tue Jul 14 14:37:05 2009" Chrome21: "Tue Jul 14 2009 14:37:05 GMT+1200 (NZST)" Safari6:   "14 July 2009 2:37:05 PM NZST" IE10:   "Tuesday, 14 July 2009 2:37:05 p.m." toLocalDateString() + ' ' + toLocaleTimeString() FF15:     "07/14/2009 14:37:05" Chrome21:   "Tuesday, July 14, 2009 14:37:05" Safari6: "14 July 2009 2:37:05 PM NZST" IE10 "Tuesday, 14 July 2009 2:37:05 p.m." Could they be any more different ?

Canon dissing Mac users

Dear Canon - Fuck you, could you possibly be more inept ? Not only have you failed to supply OS X Lion drivers for my Canon printer (CP400), or in fact ANY printer from that range (the otherwise awesome dye sublimation range of printers) - but your webpage "Mac OS X Lion Compatibility List", provided explicitly for Mac users, DOESN'T FUCKING WORK IN SAFARI. Honestly, could you care any less about Mac users? So, here's my promise; I will no longer buy Canon print products until there's at least a hint of caring a damn. When was Lion release ... was it about 10 months ago now ... and you would have had dev builds months before that ... so, do you have more than just the one Mac developer ?

Do NOT use the Flickr uploader in Aperture 3.01

Image
What a fuckin' disaster - Apple you bunch of twits ! Aperture 3 is a step forward in many ways but the Flickr uploader that comes built in was clearly the work of the junior member of the Aperture dev team. Oh, this will be easy, let's give it to Joe - he has no experience but it's only a bloody file uploader he can't screw it up too badly. Wrong. Joe fucked it up !!  So, having selected an image to upload, I click the Flickr button in the tool bar - the tooltip for the button is "New Flickr Album". It creates an Album in my Aperture Library which it synchronizes with Flickr. Great - the image uploaded. However, if I then modify the image metadata in Flickr itself (which is what I would normally do) - like give the image a new name - it get's out of synch with the Flickr Album in Aperture and the image disappears from the album. Ok, I think to myself. I'll name the image version in Aperture, and set the keywords in Aperture too - great, these things