RSSAmplifier

Blog

Sergi Mansilla

sergimansilla.comRSS feed ↗23 posts

Latest posts

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.

Refactoring in Go: goroutine concurrency

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.

React patterns: Privileged Content

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.

Real World Observables

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 disabled my extensions

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…

Making geolocation work on Geeksphone devices

This post is written for my own reference, in order to document the steps for getting geolocation working on Geeksphone

Extending JavaScript with inline unit tests

I’ve been checking out Pyret , the new language from the same guys that made <a

Add code coverage to your Node.js projects

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.

Virtual list in vanilla JavaScript

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…

Implement cursor-swiping in half an afternoon

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

The promise of Firefox OS

“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,…

Moving on

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,…

Nodejsconf in Italy

Last weekend I was at the Node.js conference in Brescia, Italy. Like every year the organizers

My talk at DynCon 2011

The video with my talk about Cloud9 IDE at DynCon 2011 is

Dynamically generating MIDI in JavaScript

Last weekend I open-sourced a small side project consisting of a JavaScript library that

Writing a JavaScript interpreter for DBN using PEG.js and canvas (Part II)

In this article I build an interpreter for the DBN language from the parsed AST generated by the grammar we defined <a

Writing a JavaScript interpreter for DBN using PEG.js and canvas (Part I)

In this first part of the article, I will define a grammar for DBN (Design By Numbers) and generate a parser for it that

GitHub in Catalan

This is awesome. From now on, Catalan users of GitHub can use the website in their native language. Thanks to the Github team initiative

Blog running on Jekyll now

That’s right, I couldn’t resist switching to Jekyll . I feel so free now! For those who

ABN Amro to Wesabe script

Wesabe is a great service. And a very big part of its greatness resides in the fact that it

YQL mashup with GWT

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.

Solitaire Encryption Algorithm implementation in F#

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…

Nth attempt

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