Skip to content

Instantly share code, notes, and snippets.

View James-Firth's full-sized avatar
🐙

James Firth James-Firth

🐙
View GitHub Profile
@James-Firth
James-Firth / tv_renamer.py
Last active August 29, 2015 13:57
Rename a folder of tv show files.
#############################################################################################
# The MIT License (MIT)
# Copyright (c) 2014 James Firth
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@James-Firth
James-Firth / keybase.md
Created January 23, 2015 02:30
For keybase.io verification

Keybase proof

I hereby claim:

  • I am james-firth on github.
  • I am jamesfirth (https://keybase.io/jamesfirth) on keybase.
  • I have a public key whose fingerprint is 2598 E5AD E3EB 0C48 0731 96B0 2844 086A 557B 9B3F

To claim this, I am signing this object:

@James-Firth
James-Firth / Audio
Last active August 29, 2015 14:14
File Format CSVs - A quick list of common file types to make file parsing easier. Comma and newline delimited for easier human parsing. Still working on adding more data. Data initiailly seeded with data from online-convert.com
"3ga",
"aac",
"aif",
"aiff",
"amr",
"au",
"aup",
"caf",
"flac",
"gsm",
@James-Firth
James-Firth / Am_I_Root.sh
Last active August 29, 2015 14:27 — forked from PerpetualBeta/gist:6653157
Bash script header to elevate a script that needs to run as "root" if it is run without sudo. Background here: http://darkblue.sdf.org/weblog/post/got-root
# /bin/sh
if [[ $EUID -ne 0 ]]; then
echo 'This script must be run as "root".'
echo 'Enter password to elevate privileges:'
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
SELF=`basename $0`
sudo $SCRIPTPATH'/'$SELF
exit 1
fi
@James-Firth
James-Firth / File_Format_CSVs.md
Last active August 29, 2015 14:27
File Format CSVs - A quick list of common file types to make file parsing easier. Comma and newline delimited for easier human parsing. Still working on adding more data. Data initiailly seeded with data from online-convert.com

File Format CSVs - A quick list of common file types to make file parsing easier. Comma and newline delimited for easier human parsing. Still working on adding more data. Data initiailly seeded with data from online-convert.com

Currently copying files from my other gist. WIP.

@James-Firth
James-Firth / snippit of RPG.java
Created February 8, 2011 06:06
Finished off the fight method and added the Greater Elves to the army
private static void createArmy(ArrayList <Enemy> enemies, int numberOfEnemies)
{
for (int i = 0; i < numberOfEnemies; i++)
{
enemies.add(new Elf());
enemies.add(new GreaterElf());
}
}
private static boolean fight(Player me, ArrayList<Enemy> army)
@James-Firth
James-Firth / an_offline_password_creator.py
Created June 8, 2012 06:40
This script creates a random list of words from A to Z (1 for each letter)
import os
import time
import random
## Variables ##
filename = "crossword_wordlist.txt" #file to load
path = os.path.abspath(os.curdir) #path to said file
output_filepath = path+"/offline_password_encryption_key.txt"
D/StatusBar.NetworkController( 914): dumpIcon[(gone) stat_sys_5signal_2|null stat_sys_wifi_signal_in_4 (gone) F]
W/RecipientPreferenceDatabase(31082): Muted until: 0
W/PhoneNumberFormatter(31082): Got local CC: CA
W/TextSecureSessionStore(31082): No existing session information found.
W/RecipientPreferenceDatabase(31082): Muted until: 0
@James-Firth
James-Firth / automate_cvs_changelogs.sh
Created May 30, 2013 21:45
CVS commit histories are file-by-file so I wanted to create a script that would check the changes, create a full changelog and email the results to me. NOTE: The regex on line 15 would need to be changed. This looks for the first UofM username, which starts with "um" all the time.
#!/bin/sh
cd /path/to/local/cvs/repo/
output="$(cvs -qn update)"
echo $output
if [ -x "$output"]
then
echo "No Updates."
else
echo "New commit available!"
echo "Updating..."
@James-Firth
James-Firth / hardlink_checker
Last active January 3, 2016 01:29 — forked from hollobon/gist:7579947
Forked from https://gist.github.com/hollobon/7579947/ This script recursively checks a directory's files for hardlinks. If there's no other links to a file the name is printed. TODO: Add flags to only print filenames above or below a link count threshold. Add a flag to be recursive.