Remember to Breathe

During a long chat with Nick, I discovered a solution to one of my long standing problems. I had a list of advice to myself on Google Keep. Not wanting to set it as my browser homepage I tried to make a habit of going to that page everyday. This obviously did not last very long, and soon, there was an item on my todo list that said, “Figure out what do to with advice to yourself”. This stupid, and funnily worded todo item remained on my list for almost a year.

Until of course Nick showed me his homepage. Yes, he had built a homepage for himself, long before the flood of “start page” browser plugins. Among the links to commonly visited pages, and the nine different search fields, what intrigued me most was the word “breathe” randomly written in the middle column. Refresh the page and the word changed to “simplify”. He had programmed it to pseudo-randomly choose from a list of words that he had selected. Jackpot!

breatho logo

Not being as old-school as he is, I decided to make a “start page” browser plugin. This was around the time of the bittersweet Mozilla announcement:

By the end of 2017, and with the release of Firefox 57, we’ll move to WebExtensions exclusively, and will stop loading any other extension types on desktop.

With support being added for chrome_url_overrides in Firefox 54, I started work on Breathe. A WebExtension that shows you a message from your pre-decided list every time you open a new tab.

breathe screenshot

You can download the extension from AMO right now, I am still working on getting it published on the Chrome Web Store (Update: Published!). If you don’t like waiting (for the Chrome version, or for updates) you can install it directly from the source.

How accidental are our existences are really, and how full of influence by circumstance.

Louis Kahn in My Architect

MediaWiki API errors in FileAnnotations

I am working on FileAnnotations’ error handling. When I started writing the patch I wasn’t aware of all the cases we’ll have to tackle, Mark was nice enough to guide. Below is a list of errors that could occur and how to handle them.

AbuseFilter does not reject the mw.Api promise, but returns an object that has a warning.

Use the abusefilter-disallowed message here.

No edit permission
This one rejects the promise and the function has the error code as a string and an object literal that has details. It has the same object again as the third argument, I wonder what that is about.

Should probably not show the add annotation interface if the user does not have permissions in the first place. In case we do, use the permissionserror message from core.

Session expired
Tested a few cases for this. If the user is logged out in the middle of adding an annotation they’d get a permissiondenied error. But if one logs out and logs into a different account in another tab, the new edit is correctly attributed to the newly logged in account.

Unreachable server
I found the api-error-http error message but haven’t been able to figure out how or when it triggers. Have filed a separate task for now.

This rejects the promise with error messages too. Could show api-error-blocked here, but it doesn’t show some of the useful information that is returned.

Protected page
Should protecting a File page automatically protect the Annotations page too? This is the same as some of the other errors, and core already has a protectedpage message.

Looking at all the api-error-* messages in core, these might show up too.

  • autoblock
  • badtoken
  • http (timeout error?)
  • timeout
  • unclassified

Here is the updated patch.

Rhythm of prime numbers

I had been reading about music theory on Wikipedia and was fascinated with the amount of mathematics involved in it. After going into the rabbit hole of the circle of fifths, the duodecimal number system, and this crazy clock face, I finally decided to go to bed. Having read so much (and understood so little), I started to wonder where prime numbers fit in.

As I understand rhythm better than harmony and melody, I decided to map the first few prime numbers to a beat. Since most prime numbers below fifty are either one more, or one less than a multiple of six, I knew it’ll lead to interesting results.


The rock beat has a hi-hat on every eighth note, and I am counting every eighth note for mapping the prime numbers. There is a snare and the bass drum on 1 and 3, and 2 and 4 respectively to make a basic rock beat, a clap for every prime number, and a cow bell for multiples of six.

The accentuation is on the 6th eighth note of the first bar, the 4th eighth note of the second bar and so on, because of prime numbers lying adjacent to multiples of six. I feel this gives the beat some swing.


Because of Jazz’s triplet beat structure, it lends itself better to multiples of six. I counted every triplet to map the prime numbers. Its the most basic jazz beat with the low tom playing for prime numbers.

Both beats sound alright and not as random as prime numbers are, mostly because we stuck to those below fifty. If you want to count along with the beat, here are slowed down versions of both:

The band Tool is known to have used the Fibonacci sequence in Lateralus, I wonder if they or someone else used prime numbers too.

To dwell

There are but two choices —
To follow the heart,
Clockwork you never understood.
Or to follow the world,
Why dream, even if you could?

No bread playing Soul out on the streets,
No soul spending days balancing sheets.
Earn the bread first, the heart can wait,
Play Soul today, the bread will come late.

Follow the heart and the world cries,
Follow the world and the heart dies.
The heart is dead,
The world moved ahead.

But the decision is simple —
Where do you often dwell?
The world or the heart.
Where do you go for solace?
Your wallet or your art?