Tag Archives: node.js

install-to-adb with command line tool!

As I said, I abhor repetition, so I added a new nifty feature to the install-to-adb module I made.

Now it also has a command line tool, and you can push and launch apps from the command line without even having to write a custom script that uses the module (of course, you can still use the module code by requiring it).

install-to-adb /path/to/your/firefoxos/app --launch

Continue reading

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

Promise.resolve(node-firefox)

As a follow up to my FOSDEM15 post, here’s the link to the Hacks post on node-firefox: Introducing node-firefox. Or if you just want to jump to the code, here’s the project page.

It has got a really positive response and we’ve already got very good questions and ideas for using it in ways that we didn’t expect. Thanks all!

I have to step away from leading the project as my backlog of devrel tasks essentially grows by the day, but I leave node-firefox in the capable hands of my colleagues .DS_Storoz (also known as Brittany Storoz) and tofumatt (also known as tofumatt). Of course I’ll still be hovering around the project and maybe building the occasional module and whatnot! You can’t get rid of me that easily… ;-)

Notes on FOSDEM 2015

FOSDEM finished a few hours ago and I’m almost literally fusing with the couch from where I’m writing this, bad body posture and all. It’s the best I can do.

I presented the latest project I’ve been working on, node-firefox, at the Mozilla track today. I was screencasting my talk but there were mechanical difficulties (namely the VGA plug disconnected), and Quicktime went bananas with the resolution change, so you’ll have to wait until the recordings for 2015 are published to watch the talk. By the way, kudos to Ioana Chiorean for her well researched introductory notes for each speaker. She never ceases to amaze me :-)

It was really challenging to give this talk because there was people getting in and out of the room all the time, other people speaking out loud, and others playing games on a tablet (with sound effects!) and it was all so distracting that at some point I said something like “sorry, I’m really distracted”. I don’t know if that’s a “speaker faux pas“, but it was the truth! Ahhh! At least neither my live demos or Nightly crashed, so there’s that ;-)

I will write a post on node-firefox soon–probably for the Mozilla Hacks blog.

I spent most of Saturday finishing code + the talk so I only had the chance to watch a few talks by other Mozilla colleagues, and they were really interesting. Probably my favourite was Marco Zehe’s plea for rethinking the way we approach accessibility: it should not be an afterthought or a “nice to have” feature, it should be built-in from day zero. And it’s not only about blindness, it’s about motor impairment, cognitive impairment, color blindness… It’s not only about being able to “tab” between elements, but also about being able to understand their meaning. So many things we take for granted! We need to build for the people, but I feel we need to change our front-end culture of chasing the shiniest and nicest framework in order to get there.

I also wasn’t really thrilled about getting into the event itself. I found on Saturday that it didn’t have a code of conduct, or rather, it had a “social conduct policy” that verged on the antisocial:

The FOSDEM organisers were surprised to hear that harassment is a common problem at open source conferences around the world…

For an event this size, I expected them to have a code. I didn’t even bother to check! Even more, Mozilla is supposed to not to sponsor or attend events without a Code of Conduct. This was really disappointing. A year ago, I decided to never attend another conference without them. And there I was in Brussels and with a talk on my hands. What do I do? Do I just give up or just go ahead and do it?

I decided to do it anyway.

I sometimes go to places I don’t really feel like going to, so that someone else won’t feel like they’re the only one “not man”. It helps normalising the fact that women do exist in this field. It also puts a strain on me, but I want to think/hope that it will be less straining over time, as more and more diverse attendees join me.

Then on my way in, there was a group of Spaniards discussing out loud how German women are or not attractive. I’m highlighting “Spaniards” here because I am a native Spanish speaker, and I can be pretty sure there was no “misunderstanding” or cultural barrier here. I perfectly understood what they said. And when I hear that, I start wondering if they’re going to be discussing the rest of women they see at the event, the type of thoughts that are going through their minds, and that makes me uncomfortable.

Walking down the halls, I got those looks I hadn’t got in a few years—more specifically, since I stopped attending heavily sexist demoscene parties: “Oh, a woman!”. My colleagues that attended FOSDEM before had assured me it was a great event and it was all OK, but they are all men and their perception surely doesn’t include getting treated as an anomaly of sorts.

Thankfully, many attendees have called for a proper code of conduct. FOSDEM has replied, in a convoluted way, what many interpret as “we will have a code of conduct”:

Code of Conduct, message received. Booklet statement not evolved for 3 years, our way of handling issues has and will continue to improve. #

Some other attendees had made a fool of themselves declaring that CoC are not needed and “women are actually not interested in technology and engineering”. Pau, your behaviour is a good reason why women won’t apply to speak at FOSDEM. Have you stopped and considered that perhaps, maybe perhaps, women have less opportunities to change plans on a month’s notice and that’s why they can’t attend? Gah…

This “incident” aside, I had difficulty enjoying the event because of its busyness. The fact that it was all free and open for anyone to attend meant there was A LOT of people around, and while there were limits on the number of people inside a room for security reasons, there was no limit on the number of people circulating or just being on the halls. It was noisy and hot and damp, and as we say in Spanish “it smells like humanity” :-P . So if you have issues with crowded places, perhaps FOSDEM is not a place you want to be in.

I certainly won’t go back until they sort out their Code of Conduct and inclusiveness issues.

Hashing passwords with Bcrypt and node.js

I have a little pet project that I’m using to learn Hapi.js.

Today I wanted to add authentication and since this is, as I said, a tiny little mini project, I want to only allow specific users (actually, just me) to log in, and not everyone+dog using bell or something of that sort. So I thought I’d go for hapi-auth-basic.

This module performs, not surprisingly, an HTTP basic authentication, and also wants a password hash generated with Bcrypt. I didn’t really find a command line thing that would generate the hash for me on this mac computer in a convenient fuss free way, and I also didn’t really spend hours looking because it’s Saturday, so in my most pragmatic move of today I decided I would just write a little snippet of code that would hash and verify the password using JavaScript.

So here it is, roughly based off this post of using Bcrypt with mongoose.
Continue reading