Skip to content

Instantly share code, notes, and snippets.

View thevirtuoso1973's full-sized avatar

Chris thevirtuoso1973

View GitHub Profile
hello_world_image(profile) :-
profile = "debug",
profile = "release",
)::set_cmd(["echo", "Hello", "World"]).
thevirtuoso1973 /
Last active August 8, 2022 16:48
Estimate Code Size
#!/usr/bin/env bash
# Use this script like `./ file1 file2 ... > output.txt`
set -eu;
function estimate()
cat $1 | wc
thevirtuoso1973 /
Last active June 8, 2021 19:16
This is an implementation of the approach described in to determine good areas to place the IPHRO system. You'd need to download the GDEM data from NASA's website.
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 /
Created August 7, 2020 15:42
Automate T1 Device Testing
#!/usr/bin/env bash
set -euo pipefail
cd ~/Documents/Code/Work/lner-app/iosApp
function testPhone() {
# Expects two arguments:
thevirtuoso1973 / config.el
Created January 3, 2020 13:33
My config.el file for doom emacs. Includes code that switches between a day/night theme depending on the time.
;;; .doom.d/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here:
;; Color theme changer depending on time
(setq hour
(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 /
Created July 11, 2019 16:14
A script to search for youtube videos (and playlists) in the command line, displaying their url/video id. Works great with youtube-dl.
#!/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 --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