Skip to content

Instantly share code, notes, and snippets.

View FreddieLindsey's full-sized avatar

Freddie Lindsey FreddieLindsey

View GitHub Profile
@FreddieLindsey
FreddieLindsey / get_file_info.py
Last active April 13, 2024 10:38
Outputs a CSV of file information for a provided list of directories
#!/usr/bin/env python3
import argparse
import csv
import hashlib
import tqdm
from pathlib import Path
from threading import Thread, Lock
from queue import Queue
from concurrent.futures import ThreadPoolExecutor
@FreddieLindsey
FreddieLindsey / mortgage_calculator.py
Last active March 17, 2020 17:45
Mortgage Calculator (inc. balance remaining after a number of payments)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
mortgage_value = float(sys.argv[1])
mortgage_rate = float(sys.argv[2]) / 100
mortgage_term = float(sys.argv[3])
mortgage_fixed_term_m = int(sys.argv[4]) if len(sys.argv) > 4 else mortgage_term * 12
@FreddieLindsey
FreddieLindsey / speedtest_multitest.sh
Created March 9, 2019 23:58
Runs speedtest against multiple servers writing results to CSV
#!/usr/bin/env zsh
alias speedtest="$HOME/.pyenv/shims/speedtest"
LOG_DIRECTORY="$1"
LOG_FILE="$LOG_DIRECTORY"/"$(date --iso-8601=seconds)".log
mkdir -p "$LOG_DIRECTORY"
touch "$LOG_FILE"
OUTPUT_DIRECTORY="$2"

Keybase proof

I hereby claim:

  • I am FreddieLindsey on github.
  • I am freddielindsey (https://keybase.io/freddielindsey) on keybase.
  • I have a public key whose fingerprint is B922 3AB8 A21B 62C6 0182 4F94 CA6C 89D5 D2A4 16B1

To claim this, I am signing this object:

@FreddieLindsey
FreddieLindsey / import_from_bitbucket
Last active May 13, 2016 09:39
Import from Bitbucket
#!/usr/bin/env python
import os, sys
import json, pprint
import subprocess
# Prerequisites:
# - GitHub Personal Access Token to be set in env to GITHUB_PA_TOKEN
# - BitBucket username in BITBUCKET_USERNAME
# - BitBucket password in BITBUCKET_PASSWORD
@FreddieLindsey
FreddieLindsey / MostCommonPalindrome.java
Created January 16, 2016 07:22
Finds the most common palindrome in a string
import javafx.util.Pair;
import java.util.HashMap;
import java.util.Map;
public class MostCommonPalindrome {
public static void main(String[] args) {
if (args.length < 1) {
System.out.println("Usage: <program> <string_to_find_palindromes>");
@FreddieLindsey
FreddieLindsey / .tmux.conf
Last active January 16, 2016 07:23
My current tmux config
# Remap prefix to Meta-a
set -g prefix M-a
bind M-a send-prefix
# Reload config without killing server
bind R source-file ~/.tmux.conf \; display-message " Config reloaded..."
# Clear history of pane
bind -n C-d send-keys "clear"\; send-keys "Enter"\; clear-history