Skip to content

Instantly share code, notes, and snippets.

View nickolasclarke's full-sized avatar

Nick Clarke nickolasclarke

View GitHub Profile
@nickolasclarke
nickolasclarke / bash_gists.md
Last active March 15, 2022 06:32
bash_gists

loop a python script with >1 arg from a single list.

i.e. pop 2 items from a list to use.

dates=('2022-01-22 00:00:00','2022-01-29 00:00:00' 
       '2022-01-15 00:00:00','2022-01-22 00:00:00' 
       '2022-01-08 00:00:00','2022-01-15 00:00:00')

for i in "${dates[@]}"; 
do 
@nickolasclarke
nickolasclarke / macos_bootstrap.sh
Last active January 20, 2023 05:55 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new MacOS machine
#
# TODO This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# -
@nickolasclarke
nickolasclarke / portfolio_projection.py
Last active July 30, 2022 02:35
A quick and dirty plot of estimated gains on a portfolio investment
from collections.abc import Iterable
from numbers import Real
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from numpy_financial import pv, fv
def variable_contribution(initial, growth_rate,years):
months = years * 12
@nickolasclarke
nickolasclarke / docker_snippets.md
Created July 19, 2020 23:47
Snippets and templates for all things Docker

#Docker Snippets

Dockefile Templates

Python Dockerfile

# Use official image, debian slim build used vs alpine. see https://pythonspeed.com/articles/base-image-python-docker-images/
FROM python:3.7-slim
@nickolasclarke
nickolasclarke / python_snippets.py
Last active July 17, 2023 02:59
Python Snippets
#Standard Library Python
## Basic CLI to run subprocess - based on file converter
#!/usr/bin/env python
import os
import shutil
import subprocess
import re
import argparse
@nickolasclarke
nickolasclarke / sources.list
Created December 19, 2016 04:12
apt-get sources.list for China
deb http://ftp.sjtu.edu.cn/ubuntu trusty main restricted universe multiverse
deb http://ftp.sjtu.edu.cn/ubuntu trusty-updates main restricted universe multiverse
deb http://ftp.sjtu.edu.cn/ubuntu trusty-backports main restricted universe multiverse
deb http://ftp.sjtu.edu.cn/ubuntu trusty-security main restricted universe multiverse
@nickolasclarke
nickolasclarke / onedark.reg
Last active December 10, 2021 16:38
onedark-windows
; NR cmd.exe PowerShell ONDEARK HEX DWORD
; -- ------- ----------- --------- ------- --------
; 00 Black Black base03 #5C6370 0070635c
; 01 Blue DarkBlue base0 #61AFEF 00efaf61
; 02 Green DarkGreen base01 #98C379 0079c398
; 03 Aqua DarkCyan base1 #56B6C2 00c2b656
; 04 Red DarkRed orange #E06C75 00756ce0
; 05 Purple DarkMagenta violet #6c71c4 00c4716c
; 06 Yellow DarkYellow base00 #D19A66 00669ad1
; 07 White Gray base2 #ABB2BF 00bfb2ab
@nickolasclarke
nickolasclarke / hterm_onedark.js
Last active May 3, 2016 06:10 — forked from russelldavies/hterm_solarized.js
Chrome/Chromium OS hterm and Secure Shell One Dark color scheme.
// Implementation of Atom's One Dark for hterm
// JS forked from russelldavies/hterm_solarized.js
// One Dark values taken from nathanbuchar/atom-one-dark-terminal
// values for One Light soon.
// Run in the JavaScript console of the hterm browser window
// Clear all existing settings - you probably don't want to do this.
// Preferences are now stored in "chrome.storage.sync" instead of
// "window.localStorage" so if you clear your preferences the changes