Skip to content

Instantly share code, notes, and snippets.


Thomas Cranny tkcranny

  • Brisbane, Australia
View GitHub Profile
tkcranny /
Last active Nov 27, 2017
Simple script to run a shell command multiple times very quickly and concurrently, and report on the failure rate.
#!/usr/bin/env python
Simple script to run a shell command repeatedly using concurrent
subprocesses. Shows a pretty progress bar, and prints a percentage of
times the command failed.
Took a ~20 minute sequence of `npm run test` to under 2 minutes.
tkcranny / Open in iTerm.workflow
Last active Aug 29, 2019
macOS Sierra Automater service to open iTerm2 from a finder window
View Open in iTerm.workflow
-- Adapted from these sources:
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set is_folder to (do shell script "file -b " & quoted form of (POSIX path of my_file))
View Comp
echo -e "\e[36m================================================================================"
echo -e "\e[35mWarnings:\e[33m"
gcc -Wall -ansi -pedantic thebox.c -o thebox
echo -e "\e[35mCompilation Complete\e[33m"
echo -e "\e[36m================================================================================\e[0m"
tkcranny /
Created Jun 6, 2013
Simple script to retreive the highest rated (1080p) image from and apply it as the windows desktop image.
import urllib2, ctypes
import os, re
from time import sleep
__author__ = "Thomas Cranny"
__version__ = "1.0"
def CheckConnection(checks=5*60, delay=1):
for i in range(checks):