Skip to content

Instantly share code, notes, and snippets.

View ansrivas's full-sized avatar

Ankur Srivastava ansrivas

View GitHub Profile
@ansrivas
ansrivas / example.toml
Created September 30, 2018 12:59
TOML Example File
# This is a TOML document. Boom.
title = "TOML Example (v0.4.0)"
#------------------------------ Comments ------------------------------
# This is a full-line comment
key = "value" # This is a comment at the end of a line
#--------------------------- Key/Value Pair ---------------------------
@ansrivas
ansrivas / git_rebase.md
Created August 4, 2018 17:53 — forked from ravibhure/git_rebase.md
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@ansrivas
ansrivas / Makefile
Created November 16, 2017 23:09 — forked from mcastilho/Makefile
Makefile for Medium article
.PHONY: all tags clean test build install generate image release
REGISTRY_REPO = <..redacted..>
OK_COLOR=\033[32;01m
NO_COLOR=\033[0m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
# Build Flags
@ansrivas
ansrivas / vort.html
Last active September 20, 2017 13:15 — forked from doobeh/vort.html
DatePicker JS Example Flask
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>DatePicker Example</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.4/build/jquery.datetimepicker.min.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
@ansrivas
ansrivas / reflection.go
Created June 5, 2017 12:19 — forked from drewolson/reflection.go
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
@ansrivas
ansrivas / Makefile
Created April 27, 2017 21:28 — forked from kwilczynski/Makefile
Makefile for my Go projects (an example).
SHELL := /bin/bash
REV := $(shell git rev-parse HEAD)
CHANGES := $(shell test -n "$$(git status --porcelain)" && echo '+CHANGES' || true)
TARGET := packer-provisioner-itamae-local
VERSION := $(shell cat VERSION)
OS := darwin freebsd linux openbsd
ARCH := 386 amd64
@ansrivas
ansrivas / Remove all git tags
Created April 21, 2017 20:46 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@ansrivas
ansrivas / supervisor
Created November 11, 2016 17:22 — forked from glarrain/supervisor
logrotate.d/supervisor: config file for logrotate for Supervisor logs (includes explanation of each directive)
/var/log/supervisor/*.log {
weekly
rotate 52
compress
delaycompress
notifempty
missingok
copytruncate
}
@ansrivas
ansrivas / logstash.conf
Created November 3, 2016 01:29 — forked from shreyaskarnik/logstash.conf
Logstash-gelf-conf
input {
gelf {}
}
output {
elasticsearch {
host => "elasticsearch"
protocol => "http"
workers=> 10
}
stdout {