Skip to content

Instantly share code, notes, and snippets.

@rajnmithun
rajnmithun / System Design.md
Created March 15, 2019 03:09 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@rajnmithun
rajnmithun / translate.go
Created August 6, 2018 16:20 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@rajnmithun
rajnmithun / commit.fish
Created June 15, 2018 21:45 — forked from paulstatezny/commit.fish
A fish shell function for committing in Git in a "Refs #123 - Commit message." format (Usage: `commit 'Commit message'`)
# Prefix commit message with "Refs #[PULL_NUMBER] - "
# PULL_NUMBER is derived from the branch name, which is assumed to be in one of the following formats:
# something/[PULL_NUMBER]-short-descriptive-name
# something/[GROUP_NUMBER]/[PULL_NUMBER]-short-descriptive-name
function commit
set issue (git rev-parse --abbrev-ref HEAD | cut -d / -f 3 | cut -d - -f 1 | grep "^\d*\$")
set message $argv[1]
set prefix "Refs #"
@rajnmithun
rajnmithun / golang_pipe_http_response.go
Last active September 12, 2015 04:02 — forked from ifels/golang_pipe_http_response.go
golang pipe the http response
package main
import (
"io"
"net/http"
"os/exec"
)
var (
BUF_LEN = 1024