Skip to content

Instantly share code, notes, and snippets.

Avatar

Kshitij Saraogi kshitij10496

View GitHub Profile
@kshitij10496
kshitij10496 / diffy_traffic.sh
Created Jul 11, 2019
Bash Script for sending traffic to diffy instance for the example Docker image.
View diffy_traffic.sh
#!/usr/bin/env bash
echo "Send some traffic to your Diffy instance"
declare -a endpoints=("success" "noise" "regression" "noisy_regression")
declare -a values=("mixpanel" "twitter" "airbnb" "paytm" "baidu")
for i in {1..10}
do
for k in "${endpoints[@]}"
do
for v in "${values[@]}"
do
@kshitij10496
kshitij10496 / pvp.py
Created Apr 26, 2019
Jena's MTP Code
View pvp.py
import numpy as np
import matplotlib.pyplot as plt
def plot(x, y, deg, well):
'''
x, y are the inputs (porosity and permeability) respectively.
deg = degree of the ploynomial best-fit curve.
well = name of the well.
'''
z = np.polyfit(x, y, deg)
@kshitij10496
kshitij10496 / build.sh
Created Jan 26, 2019 — forked from isacikgoz/build.sh
Simple bash script for cross-compiling Go code for release
View build.sh
#!/bin/bash
#
APP_VER="0.3"
BUILD_ARCH_AMD64="amd64"
BUILD_ARCH_ARM64="arm64"
BUILD_ARCH_ARM="arm"
BUILD_ARCH_x86="386"
@kshitij10496
kshitij10496 / docker-compose.yml
Created Jan 17, 2019
[Postgres with Docker]: Data Persistence
View docker-compose.yml
version: '3'
services:
postgres:
image: postgres:11.1-alpine
container_name: shadowsDB
environment:
POSTGRES_DB: "league_of_shadows"
POSTGRES_USER: "batman"
POSTGRES_PASSWORD: "blueflower"
@kshitij10496
kshitij10496 / docker-compose.yml
Created Jan 17, 2019
[Postgres with Docker]: Loading data into DB
View docker-compose.yml
version: '3'
services:
postgres:
image: postgres:11.1-alpine
container_name: shadowsDB
environment:
POSTGRES_DB: "league_of_shadows"
POSTGRES_USER: "batman"
POSTGRES_PASSWORD: "blueflower"
@kshitij10496
kshitij10496 / 2.sql
Created Jan 17, 2019
[Postgres with Docker] Table Insertion SQL
View 2.sql
INSERT INTO members (name, bio) VALUES (E'Ra\'s al Ghul', E'He is the founder of The League of Shadows.');
INSERT INTO members (name, bio) VALUES ('Bruce Wayne', E'Batman\'s secret identity is Bruce Wayne, an American billionaire, playboy, philanthropist, and owner of Wayne Enterprises.');
INSERT INTO members (name, bio) VALUES ('Talia al Ghul', E'She is the daughter of Ra\'s al Ghul.');
INSERT INTO members (name, bio) VALUES ('Bane', E'Bane was once a member of The League until he was excommunicated by Ra\'s al Ghul.');
@kshitij10496
kshitij10496 / 1.sql
Created Jan 17, 2019
[Postgres with Docker] Table Creation SQL
View 1.sql
CREATE TABLE IF NOT EXISTS members (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
bio TEXT
);
@kshitij10496
kshitij10496 / docker-compose.yml
Created Jan 17, 2019
Postgres with Docker example
View docker-compose.yml
version: '3'
services:
postgres:
image: postgres:11.1-alpine
container_name: "shadowsDB"
environment:
- POSTGRES_USER="batman"
- POSTGRES_PASSWORD="blueflower"
- POSTGRES_DB="league_of_shadows"
@kshitij10496
kshitij10496 / authors.sh
Created Oct 23, 2018
Shell command to create a list of all the authors of a Git repository
View authors.sh
# You can add this to your Makefile to make it easy to update authors.
# Let's be thankful to the community and show our gratitude. :D
git log --pretty="%an <%ae>" | sort | uniq >> AUTHORS
@kshitij10496
kshitij10496 / config.toml
Created Sep 11, 2018
Simple Hugo configuration file
View config.toml
# Hostname (and path) to the root.
baseURL = "https://<your-github-username>.github.io/"
# The site’s language code used to generate RSS.
languageCode = "en"
# Theme to use (located by default in /themes/THEMENAME/).
theme = "<your-theme-name>"
# Site title.
You can’t perform that action at this time.