Skip to content

Instantly share code, notes, and snippets.

@nareshganesan
nareshganesan / pipeline.go
Created August 12, 2021 11:43 — forked from thomaspoignant/pipeline.go
Building a pipeline system in golang
package main
import (
"fmt"
"gopkg.in/yaml.v3"
"io"
"net/http"
)
// PipelineConfig is the representation of a pipeline in the configuration.
@nareshganesan
nareshganesan / delete_git_submodule.md
Created February 26, 2021 18:00 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@nareshganesan
nareshganesan / service-checklist.md
Created July 24, 2018 08:06 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@nareshganesan
nareshganesan / github_remote_switch.sh
Last active January 11, 2017 06:46 — forked from jay-hankins/github_remote_switch.sh
Basic shell function to switch your GitHub repo remote URL from (https|ssh) to (ssh|https) respectively.
# Basic shell function to switch your GitHub repo
# remote URL from (https|ssh) to (ssh|https) respectively.
# Tested with zsh and zprezto on macOS 10.12
github_ssh_to_https (){
URL_PART=$("grep" "-Eo" "([A-z0-9-]+\/[A-z0-9-]+.git)" <<< $1)
# echo $URL_PART
NEW_URL="https://github.com/"
NEW_URL+=$URL_PART
@nareshganesan
nareshganesan / module_watcher.py
Created August 3, 2016 14:30 — forked from eberle1080/module_watcher.py
Automatically reload python module / package on file change
#!/usr/bin/env python
# Author: Chris Eberle <eberle1080@gmail.com>
# Watch for any changes in a module or package, and reload it automatically
import pyinotify
import imp
import os
class ModuleWatcher(pyinotify.ProcessEvent):
"""
@nareshganesan
nareshganesan / parse_yaml.sh
Last active July 21, 2016 09:56 — forked from pkuczynski/parse_yaml.sh
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@nareshganesan
nareshganesan / gist:46413289deae452df407
Created December 27, 2015 10:30 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch