Data structures in Go: Stacks and queues

In a previous post1, we took a look at linked lists and how we can apply them in a hypothetical use-case. In this post, we will look at two similar but powerful data structures. Modelling actions and history Think about Excel or Google docs. You know, the most ubiquitous applications for composing documents that humanity has invented. We’ve all used them in some capacity. As you might know, these apps come with various actions one can apply to a text....

February 24, 2018 · 12 min · Ilija

Data structures in Go: Linked lists

Data structures and algorithms are the bread and butter of computer science. Although sometimes they appear scary to people, most of them have a simple explanation. Also, when explained well with a problem algorithms can be interesting and fun to learn and apply. This post is aimed at people that are not comfortable with linked lists, or folks that want to see and learn how to build one with Golang....

February 18, 2018 · 14 min · Ilija

Create and manage MacOS LaunchAgents using Go

If you have ever tried writing a daemon for MacOS you have met with launchd. For those that don’t have the experience, think of it as a framework for starting, stopping and managing daemons, applications, processes, and scripts. If you have any *nix experience the word daemon should not be too alien to you. For those unfamiliar, a daemon is a program running in the background without requiring user input. A typical daemon might, for instance, perform daily maintenance tasks or scan a device for malware when connected....

January 30, 2018 · 18 min · Ilija

Packing multiple binaries in a Golang package

Recently, while writing a small Golang program for setting reminders I came across a small confusion that I guess most newcomers to Golang will have - how to organise a package in a way that will enable it to cleanly contain two or more binaries. This post is not aimed at experienced Golang programmers, it’s mostly aimed at beginners to understand how to compose more complex packages, beyond making the usual “one package one binary” ones....

January 23, 2018 · 12 min · Ilija

Understanding why and how to add idempotent requests to your APIs

Idempotency is an often used term in computer science. It’s meaning to some might not be known, to others it’s very well known. The explanation for idempotency on Wikipedia is: … the property of certain operations in mathematics and computer science that they can be applied multiple times without changing the result beyond the initial application. Essentially, idempotency is the mathematical way of saying “one can apply a certain operation on something many times, without changing the result of the operation after the first time the operation is applied”....

November 2, 2017 · 22 min · Ilija

Versioning REST APIs: The Theory and Using Grape in Ruby

Nowadays, having an API on top of your application is considered common. I’ve often been disapointed when I’ve been expecting an API of a product I like to find none. There are powerful tools out there that allow easy API integrations, like IFTTT.com. Also, if you want to build a mobile application to work aside your product (or maybe your product is mobile-first), then an API is a must-have - there’s no way around it....

October 7, 2017 · 11 min · Ilija

What happens when you DELETE a resource?

Have you ever found yourself publishing an API, either an internal or a public one? Have your ever heard from the consumers of those same APIs back? Are they happy about the functionality of your APIs and their design? You already know, there is no perfect design, but API design has to be taken very seriously. Why? Because evolving and changing APIS is hard and time consuming. Imagine you are on a team in a company, that has set off to design a company-wide API guideline and a blueprint....

October 29, 2016 · 10 min · Ilija

Sprinkle some HATEOAS on your Rails APIs

REST as a concept was introduced by Roy Fielding in his doctoral thesis, named Architectural Styles and the Design of Network-based Software Architectures. 16 years later, REST as an architecture is the most widely accepted way to design and build APIs. I am sure we have all heard about it, and most of us think we are building actual RESTful APIs. But, are we? Let’s remind ourselves what REST is and then continue on something else that supplements REST, called HATEOAS....

June 26, 2016 · 24 min · Ilija

The practicality of designing and describing your APIs

The web, as we all know, is driven by APIs. Since the rise of mobile applications and the JavaScript driven single-page applications, APIs became even more popular, as a unified way for the clients to communicate with the back-end. Most of the companies use internal APIs for different purposes. Some use them to expose resources, data or behaviour. Others, use them for authentication and authorisation, some do it for controlling the hardware layer with smart implementations under the hood....

June 16, 2016 · 11 min · Ilija

Learn your tools: Navigating your Git History

Starting a greenfield application everyday is nearly impossible, especially in your daily job. In fact, most of us are facing (somewhat) legacy codebases on a daily basis, and regaining the context of why some feature, or line of code exists in the codebase is very important. This is where git, the distributed version control system, is invaluable. Let’s dive in and see how we can use our git history and easily navigate through it....

June 6, 2016 · 12 min · Ilija