Category Archives: Software

Solving the “multiple MacVim instances” confusion

I somehow started to experience this confusing situation where I would have two instances of MacVim open, so I was able to Command-Tab between them, and it was really annoying because if I wanted to switch between different windows of MacVim I had to locate which of the instances contained the window I wanted to edit files on. See where am I getting? No? I understand, it was very confusing.

However I found what had happened: I had two versions of MacVim installed.

So when I opened something with the command line mvim shortcut, one of the instances would be executed. And when I opened some file with “open with MacVim” the other instance would be executed. Chaos ensued!

The solution was to delete the MacVim.app in the /Applications folder, and uninstall it from Homebrew:

brew uninstall macvim

and install it again:

brew install macvim

Now I’m back to just one MacVim instance. Yay!

Getting logs of your Firefox OS device

Often you want to output debugging data from your app, but the space on the screen is limited! And perhaps you don’t want to connect to the app with WebIDE and launch the debugger and etc, etc…

One solution is to use any of the console. functions in your code. They will be sent to the device’s log. For example:

console.log('hello friends!');

and you can also use console.error, console.info, etc.

Then, if you have the adb utility installed, you can get instant access to those logs when your device is connected to your computer with USB.
Continue reading

Front-end mDNS: announcing and finding network services with JavaScript

Multicast DNS (or mDNS) lets you announce a service you’re offering in the network you’re connected to, and other devices can find (discover) it. For example, you could announce that your computer is running an FTP service. It’s the same thing that Apple does with its Bonjour protocol and that’s how you can find printers without knowing their IP address: they broadcast their existence, and your computer picks it up automatically for you.

Services have to be registered with a domain ending in .local. E.g. _ssh._tcp.local. The Wikipedia page has some background on why.

However, the title of this post has “front-end” on it, and that’s because I wanted to talk about dns-sd.js, a library that lets you both register and discover services in the network. It’s all written in JavaScript so it can run on a browser environment, in this case Firefox OS.
Continue reading

Superturbocharging Firefox OS app development with node-firefox

Well, that’s funny–I finish writing a few modules for (potentially) node-firefox and then on the same day I discover the recording for my FOSDEM talk on node-firefox is online!

It’s probably not the best recording you’ve ever seen, as it is not recording the output of my laptop, but here are the slides too if you want to see my fabulously curated GIFs (and you know you want to). Here’s also the source of the slides, and the article for Mozilla Hacks that presents node-firefox and which might probably help you more than watching the video with the slides.

If you’re interested in watching the other Mozilla talks at FOSDEM they’re here.

Install to ADB: installing packaged Firefox OS apps to USB connected phones (using ADB)

I abhor repetition, so I’m always looking for opportunities to improve my processes. Spending a bit of time early on can save you so much time on the long run!

If you’re trying to build something that can only run in devices (for example, apps that use WiFi direct), pushing updates gets boring really quickly: with WebIDE you have to select each USB device manually and then initiate the push.

So I decided I would optimise this because I wanted to focus on writing software, not clicking on dropdowns and etc.

And thus after a bit of research I can finally show install-to-adb:

In the video you can see how I’m pushing the same app to two Flame phones, both of them connected with USB to my laptop. The whole process is a node.js script (and a bunch of modules!).
Continue reading