Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Programming

Chris thevirtuoso1973

💻
Programming
View GitHub Profile
@thevirtuoso1973
thevirtuoso1973 / iphroPlacement.py
Last active Jun 8, 2021
This is an implementation of the approach described in https://doi.org/10.1016/j.seta.2016.09.003 to determine good areas to place the IPHRO system. You'd need to download the GDEM data from NASA's website.
View iphroPlacement.py
import numpy as np
import os
import math
import random
import overpy
from scipy.spatial import KDTree
def simulatedAnnealing(data, maxIter=1000000):
# NOTE: this function/approach wasn't effective enough at finding the optimal value
@thevirtuoso1973
thevirtuoso1973 / automateTesting.sh
Created Aug 7, 2020
Automate T1 Device Testing
View automateTesting.sh
#!/usr/bin/env bash
set -euo pipefail
cd ~/Documents/Code/Work/lner-app/iosApp
function testPhone() {
# Expects two arguments:
name=$1
version=$2
@thevirtuoso1973
thevirtuoso1973 / config.el
Created Jan 3, 2020
My config.el file for doom emacs. Includes code that switches between a day/night theme depending on the time.
View config.el
;;; .doom.d/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here:
;; Color theme changer depending on time
(setq hour
(string-to-number
(substring (current-time-string) 11 13))) ;; gets the hour
(if (member hour (number-sequence 6 16)) ;; light theme if between 06:00-16:59
(setq now 'doom-solarized-light)
@thevirtuoso1973
thevirtuoso1973 / searchTube.py
Created Jul 11, 2019
A script to search for youtube videos (and playlists) in the command line, displaying their url/video id. Works great with youtube-dl.
View searchTube.py
#!/usr/bin/env python2
# ^ also compatible with python3 ^
# This script executes a search request for the specified search term and prints the results.
# Sample usage:
# python searchTube.py --max-results=10 "megadeth album"
# uses the google api client module for python so make sure you install it
import argparse
from googleapiclient.discovery import build