Streaming HTML to your Browsers

September 182017

PSA: This article is in no way related to the Stream’s Standard. There are several strategies to reduce the time for a page to receive meaningful content and become interactive. Today we will be looking into one of the strategies that involve changing the way we serve content from the back-end. Server-side rendering can be slow as we don’t render anything to the page until we have made all the database queries, massaged the data, and sprinkled all the additional scripts we need before a user can see it.

Read More

Going Offline with Service Worker

December 92016

I have had Service Worker working on this site (on and off) for a while now. Caching everything other than posts. When I moved away from github-pages to Surge I had to forgo the HTTPS support, which meant no more offline caching. However, I have switched back to github-pages with Cloudflare providing the HTTPS certificates. This is temporary until I move to a platform where I can explore other PWA patterns.

Read More

Progressively Decoupled Drupal with React

October 92016

I briefly talked about progressively decoupling in my session at DrupalCon Dublin and I would like to expand on couple of techniques that have worked out well for me. I’ll be using React as the client-side framework but it should work equally well with other frameworks too. I choose React because of it’s small size and my familiarity with it. Progressive Decoupling Unlike Fully Decoupled Drupal solutions where you have to serve a completely isolated website on a different technology stack, with Progressively Decoupled websites you can gradually build out a library of components while staying inside Drupal.

Read More

Signing commits with GPG and Keybase

August 312016

Introduction Git can be easily hacked to alter the integrity of the respository. Changing author details and code history are just a rebase away. $ git commit --author Linus Torvalds <> To validate commits and tags you can sign them with GPG keys. GPG allows you to encrypt and sign messages/data using a pair of keys: public which can be shared over the internet and a private key, that you keep safe on your machine.

Read More

Concurrent Elixir: Processes

August 272016

Introduction Processes are the bread and butter of Elixir’s concurrency. Unlike operating system threads, Elixir has green threads which are efficient and light on resources. These processes communicate and synchronize with each other by message passing. It is a common pattern among Elixir and Erlang developers to spin up thousands of processes without worrying about performance as processes are isolated and memory is cleared with every process that ends or is killed.

Read More

HTTP requests in Elm

July 272016

Introduction Elm is a strictly typed functional programming language that compiles down to JavaScript. The first feature Elm showcases on its website is No runtime exceptions, which is a huge claim considering how frequently you run into them. There are just a few other languages that make this claim and all of them share a common feature: managed effects. This means that actions that require mutations like HTTP requests or writing a file to disk are all treated as data.

Read More

Deploying static sites on Surge using GitHub and Travis

July 252016

Introduction I archived the last iteration of my site which I had been hosting on GitHub pages for several years now. This setup has worked fine for me but there were a bunch of reasons for me to move away from it. I wanted to switch from Jekyll to a faster static-site generator. I’m was not happy with installing one more language (ruby) on my machine just to build static website.

Read More

CS101: Selection Sort

July 242016

Memory Computer memory can be thought of as a huge chest with hundreds and thousands of drawers. Each drawer can store some data. Whenever you store something in a drawer, you get back an address pointing to it. You can use this address to access the content inside it or to manipulate what’s already in there. If you are storing something in memory, your computer will look for free space and give you an address where it can save it.

Read More

CS101: Binary Search

July 232016

Preface A few years back, I was studying as a computer science student (Bachelors in Information Technology) and like every other student in my class I was ill-informed that whatever they taught at college was outdated, impractical, and useless to a web developer. To me they were teaching low level languages like C and C++ which as a web developer, I would never touch with a ten foot pole or microprocessors that weren’t powerful enough to run todays feature phones.

Read More