About a week back was my last day at Tarka Labs. So many people have asked me why I have left a wonderful organization, this post is to gather and summarize my thought process…

A little about me, my name is Gaurav Agarwal. I was born 10019 days ago, as on the day of publishing this article, and I have no idea how many more are to come. I have an extremely blessed life and am thankful for all the stars that aligned to bring me to this world. I have found technology and business to be my calling ever…


Since you are reading this post, I am guessing, you are probably familiar with Flutter. If not,

Flutter is Google’s mobile UI framework for crafting high-quality native interfaces on iOS and Android in record time. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.

“… in record time.”, well I am sold! You can see it in action in this Google I/O ’17 talk. Let’s begin by setting it up.

Installation

Flutter can be installed by cloning it, for the master channel. …


Disclaimer: This post is more or less a transcript of the videos by Jim from jetsonhacks.com.

I am a beginner to the world of machine learning and own a couple of Macbooks. I found the Nvidia Dev board (TX1) to be the best way to get started and run a few tensorflow / Cuda code on. Before I could do that, I had to make sure it was usable, and that was much more than I had bargained for.

Setup JetPack 3.2 on TX1

Annoyingly, the Nvidia TX1 Dev board is not directly flashable via a usb stick. You need a host machine where you…


I had written a small script sometime in 2014 for me to separate out the stale branches from the most relevant branches in a git repository.

Today, I was working on a bunch of repositories. I wanted to figure out the recent most branches, and their relevance in relation to master. It hit me out of nowhere and I remembered the script I had written earlier.

First, see the script in action:

Listing

Alternatively, you can view it on asciinema.

Analysis

Right off the bat, I can see that


I had started using glide when I initially started learning Go. Since then, I have moved to dep.

In an existing project, with dependencies managed by glide, an easy way to switch to dep is to run:

$ dep initImporting configuration from glide. These are only initial constraints, and are further refined during the solve process.
Detected glide configuration files...
Converting from glide.yaml and glide.lock...
Using ^1.6.0 as initial constraint for imported dep github.com/gorilla/mux
Trying v1.6.1 (53c1911) as initial lock for imported dep github.com/gorilla/mux
Using ^1.0.0 as initial…

This is Part 5 of “Learn go” series. Probably the last in this series. You can find the previous post here.

This post picks up from the previous posts Part I, Part II, Part III and, PartIV , so if you haven’t read, please skim through it.

Introduction

Sometimes writing test cases in a new language can be intimidating. This post focuses on writing readable BDD style (for those familiar with Rspec, already know what I am talking about) tests instead of xUnit style. And also documenting API endpoints.

Golang has excellent support for xUnit style tests built in. If you…


This is Part 4 of “Learn go” series. You can find the previous post here.

As a beginner to Golang, it was relatively painful to figure out an ideal project structure where code isn’t dumped into one single file or package even. This post sums up my learnings to keep things simple by splitting project across multiple files and packages.

This post does not pick up from the previous posts Part I, Part II and, Part III.

All of the code from this series can be found in this repository.

Directory listing

Listing

Alternatively, you can view it on asciinema.

Packages

I have defined…


Alternate title: Working with JWT, CORS as middlewares using Negroni.

This is Part 3 of “Learn go” series. You can find the previous post here.

In this post, I will be walking you through an example of adding middlewares for working with JWT for sessions. As well as making an API, CORS compatible. This post picks up from the previous posts Part I and, Part II, so if you haven’t read, please skim through it.

Let’s begin…

Problem Statement

We need an API where when we login, we get a JWT token back for authentication, similar in the manner to session cookies.

Creating the Login API


This is Part 2 of “Learn go” series. You can find the previous post here.

In this post, I will be walking you through an example of interacting with database. A very common scenario, creating a user and storing the password securely. This post picks up from the previous post, so if you haven’t read, please skim through it.

Let’s begin…

Defining the problem

We are going to be creating a sign up end-point. For this, we begin by…

Defining the type User

user.go

package model

import "github.com/jinzhu/gorm"

type User struct {
gorm.Model …


This is Part 1 of “Learn go” series. This series assumes you have a general familiarity of the golang syntax and types. If not, I urge you to follow the interactive tour of go and/or watch Russ Cox’s video

In this post, I will be walking you through an example of writing a Hello World json end point. So lets begin with…

A Simple “Hello World!”

main.go

package main

import "fmt"

func main() {
fmt.Println("Hello World!")
}

Now compiling it as:

$ go build -o main

and running:

$ ./mainHello World!

Alternatively, you can skip the above using:

$ go run main.goHello World!

Gaurav Agarwal

Software Engineer -> https://algogrit.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store