This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE circuits( | |
circuitId INTEGER NOT NULL PRIMARY KEY, | |
circuitRef VARCHAR(255) NOT NULL, | |
name VARCHAR(255) NOT NULL, | |
location VARCHAR(255) DEFAULT NULL, | |
country VARCHAR(255) DEFAULT NULL, | |
lat NUMERIC(8,5) DEFAULT NULL, | |
lng NUMERIC(10,6) DEFAULT NULL, | |
alt INTEGER DEFAULT NULL, | |
url VARCHAR(255) NOT NULL UNIQUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Helper function to generate random integer in a range. | |
-- Extremely useful for generating mock data for testing. | |
CREATE OR REPLACE FUNCTION RANDOM_BETWEEN(low INT ,high INT) | |
RETURNS INT AS | |
$$ | |
BEGIN | |
RETURN floor(random()* (high-low + 1) + low); | |
END; | |
$$ language 'plpgsql' STRICT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: help | |
help: ## Show this help. | |
@echo "Targets:" | |
@grep -E '^[a-zA-Z\/_-]*:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\t%-20s: %s\n", $$1, $$2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
APP_VER="0.3" | |
BUILD_ARCH_AMD64="amd64" | |
BUILD_ARCH_ARM64="arm64" | |
BUILD_ARCH_ARM="arm" | |
BUILD_ARCH_x86="386" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
postgres: | |
image: postgres:11.1-alpine | |
container_name: shadowsDB | |
environment: | |
POSTGRES_DB: "league_of_shadows" | |
POSTGRES_USER: "batman" | |
POSTGRES_PASSWORD: "blueflower" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
postgres: | |
image: postgres:11.1-alpine | |
container_name: shadowsDB | |
environment: | |
POSTGRES_DB: "league_of_shadows" | |
POSTGRES_USER: "batman" | |
POSTGRES_PASSWORD: "blueflower" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS members ( | |
id SERIAL PRIMARY KEY, | |
name TEXT NOT NULL, | |
bio TEXT | |
); |
NewerOlder