Showing posts with label Mac OS X. Show all posts
Showing posts with label Mac OS X. Show all posts

10/10/2012

Getting Started Developing for Firefox OS Screencasts

I've been working on Boot 2 Gecko (Firefox OS) for the last 9 months now, and it has been both a completely insane project and an awesome project. Insane amount of work, awesome implementation.

Writing an OS from the ground up is no easy task. Luckily, we're not doing that. We are building on top of the linux kernel and gecko, both open source projects that have lots of effort put against them.

It is really starting to firm up now, especially after a few weeks ago when we had the feature freeze. There is still a lot to do, however, and we are going to be trying to bring in developers from other areas of the company to help fix bugs and make this thing stable.

Luckily, the development process just got a lot easier with two things that recently landed. One is that the b2g desktop nightly builds now include a build of gaia, so you can just download a nightly build, double-click, and go. The other is that the remote debugger gained the ability to load code over-the-wire as part of the debugger protocol, so the way gaia packages up apps and refers to them using app:// urls is now debuggable without nasty workarounds.

As we are ramping up newer developers to help with the project, we need clear documentation of the development process. The Gaia/Hacking page is the canonical reference for how to do absolutely everything, but it's overwhelming. To help with this, I made a series of 5 screencasts that cover the basics of using b2g desktop nightly builds, remote debugging with b2g desktop, hacking on gaia itself in b2g desktop, flashing a phone with gaia changes, and what to do if Firefox OS asks you to choose from two homescreens or if remote debugging does not show your source for your app.

As an aside, I find it hilarious that there are all these incorrect rumors about the speed and the memory of the phone, when the correct specs were actually *announced* in February. I guess people would rather speculate and spread rumors than read press releases.

B2G Desktop Intro (Firefox OS)

B2G Desktop Intro (Firefox OS) from Donovan Preston on Vimeo.

Debugging Gaia (Firefox OS) with the Remote Debugger

Debugging Gaia (Firefox OS) with the Remote Debugger from Donovan Preston on Vimeo.

Hacking on Gaia in Debug Mode

Hacking on Gaia in Debug Mode from Donovan Preston on Vimeo.

Flashing Gaia onto a Firefox OS Phone and Remotely Debugging a Firefox OS Phone

Flashing Gaia to a Firefox OS Phone and Remotely Debugging a Firefox OS Phone from Donovan Preston on Vimeo.

Firefox OS Tips

Firefox OS Tips from Donovan Preston on Vimeo.

3/15/2005

Using Python to find Type/Creator codes

It has been a while since I needed to know about old-style Mac Type/Creator codes, but today I wanted to search my hard drive for files of a specific type. I thought you used to be able to drag a file into the find file Type box and it would automatically assign the Type to the input box, but this no longer seems to be the case on OS X.



I thought about downloading some utility which would allow me to see the Type code of a file of the same Type as the one I was trying to find, but then I realized I could probably do it with Python, and I was right.




>>> MacOS.GetCreatorAndType('/Volumes/Stormbringer/Audio/New Sessions/Guitar Project/Guitar')
('MOUP', 'PERF')


I also find myself occasionally using the Python REPL to do things like perform some quick math, convert between a char and the ordinal of that char, and look up unicode glyph names and resolve them. Instead of downloading some specific program to do some task, I have access to this vast functionality space which I can use to create my own utilities simply by remembering the steps to perform.



3/12/2004

Using TextEdit as your EDITOR

Anyone who has used Unix for a while knows about EDITOR. It's an environment variable you set to tell applications that want you to edit stuff what your preferred editor is. It's usually set to vi by default and it's easy enough to figure out how to set it to emacs or pico. But what if you want to set it to something like TextEdit or SubEtheaEdit?

You can't set it to /Applications/TextEdit.app because to the shell, that looks like a directory. You can't set it to "open -a TextEdit.app" because open will return immediately and the program which is asking you to edit something will think you didn't make any changes. The solution is to set it to the actual executable inside of the bundle:

/Applications/TextEdit.app/Contents/MacOS/TextEdit

If you run the actual executable inside the bundle from the shell, the OS will actually fire up a new copy of that application, blocking the shell until the application quits. Pretty weird, and useful in certain situations.

Setting your editor to TextEdit gives you the benefit of spell checking, services, etc, and generally feels nicer for someone who is more used to the Mac than to Unix.