Skip to content

Instantly share code, notes, and snippets.

@chinmay185
chinmay185 / gogrep.go
Created March 25, 2017 09:31
Grep like command implementation in Go
package main
import (
"io/ioutil"
"os"
"log"
"bufio"
"fmt"
"strings"
"path/filepath"
@chinmay185
chinmay185 / josephus_using_channels_goroutines.go
Created March 25, 2017 11:48
Simulates Josephus problem solution using Goroutines and Channels
package main
import (
"fmt"
"time"
)
type Command struct {
message string
senderId int
@chinmay185
chinmay185 / grep_parallel.go
Last active April 14, 2017 16:02
basic simulation of grep command using multiple goroutines (for tests, see https://gist.github.com/chinmay185/15e0a81deee73571ce9b74d65d1da7eb)
package grep
import (
"bufio"
"flag"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
package grep
import (
"os"
"path/filepath"
"strings"
"sync"
"testing"
"time"
)
@chinmay185
chinmay185 / rest-api-design-with-otp-based-auth-example.md
Last active January 29, 2024 15:36
REST API design example - OTP based auth

Problem statement:

Design the auth flow apis (signup, login, etc) for an OTP based user authentication. Assume OTP will be created and presented to users upon a successful login.

API Signature:

- URL
- Request Method
- Request Headers