Skip to content

Instantly share code, notes, and snippets.

View thevirtuoso1973's full-sized avatar
💻
Programming

Chris thevirtuoso1973

💻
Programming
View GitHub Profile
@thevirtuoso1973
thevirtuoso1973 / searchTube.py
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 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
@thevirtuoso1973
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
(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 / automateTesting.sh
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:
name=$1
version=$2
@thevirtuoso1973
thevirtuoso1973 / iphroPlacement.py
Last active June 8, 2021 19:16
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.
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
hello_world_image(profile) :-
(
profile = "debug",
from("ubuntu")
;
profile = "release",
from("alpine")
)::set_cmd(["echo", "Hello", "World"]).
@thevirtuoso1973
thevirtuoso1973 / code_size.sh
Last active August 8, 2022 16:48
Estimate Code Size
#!/usr/bin/env bash
# Use this script like `./code_size.sh file1 file2 ... > output.txt`
set -eu;
function estimate()
{
cat $1 | wc