The Changelog – Open Source moves fast. Keep up.
Want new gesture controls in iOS 4.3 on your iPad? Here’s how
During one of the betas for iOS 4.3 we saw new gestures enabled (like pinch to go to the Home screen). They were later removed, but it appears they can be re-enabled by turning your iPad into an iOS developer iPad.
via Want new gesture controls in iOS 4.3 on your iPad? Here’s how.
Staying busy
Wow, I just realized my last post here was in October 2010. It’s been a while. Turns out, October was when we launched the last project I was working on at LEVEL Studios. I am still working on that project, but doing back end stuff in C#.Net. Besides a couple of days working on another project for Agora Games, I have not touched Javascript at all. Maybe that’s why I had nothing to write here.
Either way, I have many things and thoughts to share, but not a lot of free time to do it. I’ll try to keep posting about all the stuff I am working on now.
Javascript console in the terminal (command line)
I’ve been looking for a command line Javascript console for a while. I have even thought of creating my own one, some hybrid between my fake Linux terminal and JSFiddle.net. Lately, I’ve been working with node.js lately on a little project just for fun. Never before I had done server side Javascript and it looks like it has serious potential. But still, I had no console other than Firebug or, my favorite, the one included in Webkit.
So I am very happy after coming across this article which shows how to use the JavaScriptCore.Framework included in Mac OS X on the command line. Doing some Google searches, looks like people have been talking about this for a long time. Even more! Here is how to compile javascript to .exe in Windows. Didn’t even thought that could be possible, being Javascript such a dynamic language.
One interesting thing about the jsc Javascript console is that you can load() javascript files from disk. Thus, one can get the Mootools core (Core + Function + Array + Number + String + Hash + Class + Class.Extras + JSON) and load it to start creating awesome classes, etc.
This is going to be a lot of fun :)
Having fun with node.js & Redis
Last week I set up node.js for the first time. I did it on my Dreamhost shared server, but since that goes against the Terms of Service, I set up a small dedicated virtual server at RackspaceCloud.
My configuration uses:
- Ubuntu 10.04.1
- subversion
- node.js
- grasshopper
- node_redis
- redis
So far it’s been a lot of fun, I’ll give more details about the installation steps and configuration later on :)
Date from ISO 8601 string
Javascript is full of surprises and browser compatibility is even more exciting. For some reason, I thought all browsers or Javascript engines had support for creating dates from ISO 8601 strings. Like this:
-
var myDate = new Date("2010-09-21T02:57:00Z");
-
console.log(myDate); // Mon Sep 20 2010 19:57:00 GMT-0700 (Pacific Daylight Time)
Turns out that does not work on Internet Explorer (tested on IE8). It didn’t work in Titanium Developer either, when I was working on an iPhone/Android app a couple of weeks ago. Here is the function I used to load dates from ISO 8601 strings:
-
function dateFromISO8601(isostr) {
-
var parts = isostr.match(/\d+/g);
-
return new Date(parts[0], parts[1] – 1, parts[2], parts[3], parts[4], parts[5]);
-
}
-
var myDate = dateFromISO8601("2010-09-21T02:57:00Z");
-
console.log(myDate); // Mon Sep 20 2010 19:57:00 GMT-0700 (Pacific Daylight Time)
That should work fine everywhere :)
MooTools Core for Server and Mobile Development
One of the best things of MooTools is that it is very modular, from the core itself. This means you don’t need to include all core elements in your projects if you don’t want or don’t need some modules. For example, you may not want to include Array or Function, if you don’t need any enhancements of such objects.
In the case of server side or mobile applications (Titanium Developer and other Javascript based mobile frameworks), there is no browser involved which means there is no DOM. Thus, we can removed any kind of module that depend or are designed to work with this elements: Browser, Element, Selectors, Cookie… all those modules have no value for server side or mobile applications.
I found this page which summarizes the modules you should need for server or mobile development:
MooTools Core
Core: core
Native: Array, Function, Number, String, Hash
Class: Class, Class.ExtrasMooTools More
Core: More
Class: Class.Refactor, Class.Binds, Class.Occludes
http://onecrayon.com/spice/docs/mootools-server/
Personally, I don’t find the MooTools More modules very useful, so I’m not including them in my projects. Maybe Binds would be a good addition, but it is not critical.
Having MooTools in a Javascript application makes it easier to develop and brings you all the power of Object Oriented programming with classes, inheritance and more.
Link: Whirlpool JS
Whirlpool is a very strong hashing algorithm (one way encryption) that encodes any text into a 128 character string (popular md5 generates a 32 byte string).
Looking for the JavaScript version, I had to search on my email inbox for an email I received back in October 2009 to found the link where to download the Whirlpool Hash Javascript Algorithm. It’s kind of surprising that searching in Google for “whirlpool js”, “whirlpool javascript” or “whirlpool hash javascript algorithm” does not return the link.
For the record, here is the url:
Whirlpool Hash Javascript Algorithm
List of iPhone ipsw firmware files (yes, downgrading from iOS 4.0.1 to 3.1.3)
So I finally decided to downgrade my iPhone 3G from iOS 4.0.1 to iPhone OS 3.1.3. For some reason, Apple does not keep the old ipsw restore files easy to find and most posts on Internet are missing a link to them. Here is a list of some of them:
iPhone 3.1.3 firmware for iPhone 2G
iPhone 3.1.3 firmware for iPhone 3G
iPhone 3.1.3 firmware for iPhone 3GS
I have downgraded my phone following this article: Downgrade iOS 4.1 iPhone 4, 3GS, 3G and iPod touch to iOS 4 / iPhone 3.1.3 / 3.1.2 [How to Guide]
The process is super simple, I couldn’t believe it was so easy, specially, since RecBoot runs so clean and fast. What the tutorials don’t say, although I expected it, is that you will lost all your data (as every time you recover). The problem is the next time you connect to iTunes, you wont be able to restore from your latest backup since it would be for a newer OS version.
Luckily, iTunes keeps track of old backups. I’m currently restoring from a backup I have from April 2010, probably the last one before I updated to the back then beta version of iOS 4.
