Refactoring in Go: Using reflection
Go’s reflection API is quite the unknown for many developers. In this article, I’ll use it in a familiar scenario to show that it can help you in your day to day coding.
Go’s reflection API is quite the unknown for many developers. In this article, I’ll use it in a familiar scenario to show that it can help you in your day to day coding.
Surprise! I write Go these days. Lately I’ve been finding some code out in the wild that uses naive solutions for concurrency. Given the times I’ve seen similar patterns, my theory is that it is probably inspired by basic goroutines example code out there.
In the last project I worked on, some parts in the page should only be shown to privileged users. As easy as it would be to just add that bit of logic in a render method, it would not be idiomatic React, and it would also get cumbersome when the validation logic becomes more complex, besides the fact that we would have to add similar logic in many places in the code. DRY, as they say.
Reactive code examples can be mind-blowing. Powerful, succint, robust…they seem to handle many concurrency scenarios without breaking a sweat. But let’s be honest, examples from 30-minute conference talks and short blog posts rarely reflect the messy real world™. In any case, developers get all pumped up about reactive goodness and want to use it in their projects. Alas, they quickly find out that…
Firefox—my browser of choice—just updated to version 41 beta. It turns out that from this version on, any extension that hasn’t been signed by Mozilla is disabled automatically . Firefox didn’t warn me about that. I had to go to the Add-ons panel to check why some of my extensions were not working, only to find that they were disabled. And I can’t seem to find a place in the UI to opt out and…
This post is written for my own reference, in order to document the steps for getting geolocation working on Geeksphone
I’ve been checking out Pyret , the new language from the same guys that made <a
Note: This blog post is inspired on Xavier Seignard’s blog post . He gives a longer introduction on it, and integrates it together with Sonar . You should check it out. Code coverage is convenient to get an overview of how well-tested your program is. I’m going to show you how to set up code coverage using Mocha , Istanbul and LCOV in two easy steps.
Let’s say you need to show a scrolling list with millions of rows, or even a reasonably big list with visually complex rows, each one composed by several DOM elements or CSS3 effects. If you try to render this the naive way, for example by appending rows into a DOM container with the CSS overflow property set to scroll (or auto ), you will most likely run into performance issues. This is because…
If you haven’t seen it yet, I suggest that you take a look at this concept video that made the rounds on the internet some months
“But how is it going to beat Android or iOS?” That’s the reaction many people have when I tell them that I am working on Firefox OS , the new mobile operating system from Mozilla . It is a logical reaction. After all, we live in times where every major software company and its mother is releasing a mobile platform, struggling to lure developers into their new proprietary environment, APIs,…
A little bit more than two years ago I was sitting on a meeting room, listening to Ruben Daniels and Rik Arends, the two founders of the company I was considering to join, Cloud9 IDE . These were two of the smartest, most inspiring people I’ve met, and they were working hard on a ground-breaking concept: a full-fledged development environment that run in the browser, and in the cloud. At the time,…
Last weekend I was at the Node.js conference in Brescia, Italy. Like every year the organizers
The video with my talk about Cloud9 IDE at DynCon 2011 is
Last weekend I open-sourced a small side project consisting of a JavaScript library that
In this article I build an interpreter for the DBN language from the parsed AST generated by the grammar we defined <a
In this first part of the article, I will define a grammar for DBN (Design By Numbers) and generate a parser for it that
This is awesome. From now on, Catalan users of GitHub can use the website in their native language. Thanks to the Github team initiative
That’s right, I couldn’t resist switching to Jekyll . I feel so free now! For those who
Wesabe is a great service. And a very big part of its greatness resides in the fact that it
Yahoo came up with YQL a few weeks ago, and I think it is a very interesting idea. It is basically a SQL-like language that allows developers to retrieve structured data from multiple Yahoo web services without having to deal with each service particularities; developers can query any service in a generic way, just like they would do retrieving rows and columns from a SQL database.
I first read about the Solitaire algorithm in the novel Cryptonomicon , by Neal Stephenson. Being a geeky kid fascinated by computers I thought that it was a brilliant idea, but my curiosity didn’t go so far as to make me write an implementation of it (you can find a perl version in the book, which by the way I consider to be another great way to encrypt information). Solitaire is a Stream Cipher…
Yes, I am blogging again. But this time I have a plan. My last blog tried to cover too many things, from my life abroad, to ramblings on