Skip to content

Instantly share code, notes, and snippets.

View ppsreejith's full-sized avatar
🗒️
Learning

Sreejith Pp ppsreejith

🗒️
Learning
View GitHub Profile
@ppsreejith
ppsreejith / Contract.md
Created January 12, 2024 10:00
Random D&D Contract

Adventurer's Contract: Operation Emerald Peak

Issued By: The Eldarwood Dominion Council

Objective: Secure and Hold Emerald's Peak

Context

The Eldarwood Dominion is in urgent need of securing the mining routes through the Oreheart Mountains for the establishment of a critical railroad network. Our efforts have been continuously thwarted by the formidable Bloodtusk Orc Tribe, who have entrenched themselves at Emerald's Peak. This location has proven to be a strategic military stronghold, and all attempts at negotiation and previous military efforts have failed.

Primary Tasks

@ppsreejith
ppsreejith / spend-calculator.py
Created September 10, 2019 08:08
To calculate spending and burn rate over a large period of time
G_CONSTANT_AMOUNT = 400000.0 # Minimum bank balance kept or liquid cash
G_INITIAL_INVESTMENT = 150000.0 # Existing investments
G_MONTHLY_INVESTMENT = 70000.0 # How much you plan to invest monthly
G_RETURN_RATE = 1.11 ** (1.0/12.0) # compound annual return rate on investment (maybe last 5 years?)
G_INFLATION_RATE = 1.08 ** (1.0/12.0) # compound annual inflation rate (maybe last 10 years?)
G_CURRENT_SPENDING = 80000.0 # Current (and planned future) monthly spending
G_LEEWAY_MONTHS = 3.0 # Number of months you need to keep spare (maybe to look for a new job etc)
def compound(principal, investment, rate, time):
"Compound interest calculator"
["background",
"tench",
"goldfish",
"great white shark",
"tiger shark",
"hammerhead",
"electric ray",
"stingray",
"cock",
"hen",
@ppsreejith
ppsreejith / spending_calc.py
Created November 24, 2018 16:07
Spending calculator
#Everything is monthly
G_INITIAL_AMOUNT = 0.0
G_INVESTMENT = 1200.0
G_INTEREST_RATE = 1.07 ** (1.0/12.0)
G_INFLATION_RATE = 1.0228 ** (1.0/12.0)
G_CURRENT_SPENDING = 1000.0
def compound(principal, investment, rate, time):
"Compound interest calculator"
@ppsreejith
ppsreejith / install.sh
Last active March 30, 2021 06:16
Favourite tools
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get -y update
apt-get -y upgrade
apt-get -y install zsh emacs silversearcher-ag docker-ce htop nginx jq
if [ ! -f /usr/local/bin/docker-compose ]; then
echo "Installing docker compose"
VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r)
curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
@ppsreejith
ppsreejith / reducer_template
Created March 9, 2017 14:06
A template for object function based reducers.
import Immutable from 'immutable';
import _ from 'lodash';
const initialState = Immutable.Map({
data: 5
})
const reducers = {
FILTER_EDIT: (state, {data}) => state.merge({data}),
FILTER_INC: (state) => state.updateIn(['data'], val => val+1),
@ppsreejith
ppsreejith / nginx.conf
Last active November 27, 2017 13:30
nginx conf for s3 proxy
worker_processes auto;
pid /run/nginx.pid;
daemon off;
events {
worker_connections 1024;
}
http {
sendfile on;
@ppsreejith
ppsreejith / simple_server.py
Last active February 27, 2017 06:18
A simple python http server
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
PORT_NUMBER = 8080
class myHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type','text/html')
self.end_headers()

Keybase proof

I hereby claim:

  • I am ppsreejith on github.
  • I am ppsreejith (https://keybase.io/ppsreejith) on keybase.
  • I have a public key whose fingerprint is 4CC9 7B47 29F5 EABE 0C6B 73AC A8F0 1505 C9DD 49BA

To claim this, I am signing this object:

@ppsreejith
ppsreejith / dist_calc.py
Created January 6, 2016 09:22
Calculating distance for csv file
import googlemaps
import csv
gmaps = googlemaps.Client('YOUR_API_KEY_HERE')
with open('NAME_OF_FILE.csv') as info:
read = csv.reader(info)
ans = []
for row in read:
ans.append(row[0] + ", Hong Kong")