Don’t repeat yourself (DRY) is a principle of software development aimed at reducing repetition of software patterns, replacing it with abstractions or using data normalization to avoid redundancy.
Decorators are an awesome feature of Python. They allow you to wrap your functions in a so-called decorator to get extra functionality for free. Let’s see how we can use them to reduce duplicate code!
Common examples of decorators are Flask routes:
Here the decorator will make sure our route is registered at the provided path, and will call the supplied function when someone sends a request to the root of your website. …
Let’s say you have an application that contains a request log. The log consists of 4 fields and is stored in a Postgres database. The table looks like this:
In our backend we want to use the same function to both update an existing request, or create a new one, based on if we pass in a value for ID.
Normally we’d have to write multiple queries to achieve this.
One to see if a row already exists, then based on that either
In this blog, we’ll explore how to achieve a so called
UPSERT (update & insert) in just 1 query. …
Automation, Noun: The use or introduction of automatic equipment in a manufacturing or other process or facility
As a developer the thing I like most is writing code, building new things, making awesome features and creating awesome experience for our users. For example: our AR experience which you can read about here.
One of the things that is less liked by me is our iOS release process. The default iOS release process consists of multiple manual steps that take quite some time, during which it’s not always possible to use your machine for other things. …
June 5th, 2017 — McEnry convention centre San Jose
WWDC had just began. During the keynote, apple relased ARKit, which overnight became the biggest AR platform in the world.
At the time, I was 15 and somewhere in the keynote audience as a scholarship winner. As you might expect, I was quite excited and couldn’t wait to try it. …