Skip to content

Instantly share code, notes, and snippets.

View torrottum's full-sized avatar

Tor Røttum torrottum

View GitHub Profile
// ==UserScript==
// @name AI: Foundations of Computational Agents key navigation
// @namespace https://torrottum.no
// @version 0.1
// @description Allows you to use arrow keys or vi-style (hkl) keys to navigate the Artificial Intelligence: Foundations of Computational Agents book
// @author Tor Røttum
// @match http://artint.info/2e/*
// @grant none
// ==/UserScript==
@torrottum
torrottum / remove.py
Created July 7, 2016 13:28
Remove uploads from WordPress that doesn't exist in the database
#!/usr/bin/env python3
from subprocess import Popen,PIPE,STDOUT
import sys
import os
"""
Removes all WordPress attachments that doesn't exist in the database
You need to be inside your uploads folder
RUN AT YOUR OWN RISK! (You should probably take a backup of the uploads dir)
@torrottum
torrottum / EOSUtilityInstaller.sh
Created February 11, 2014 20:57
EOS Utility installer for OS X since Canon only allows to update exisiting installs
#!/bin/bash
set -o pipefail
if [[ -z $1 ]]; then
echo "Missing EOS Updater Utility dmg argument";
echo "Usage: "
echo "$0 path-to-eos-utility.dmg"
echo "For example: "
echo "./EOSUtilityInstaller.sh eu2.13.40x-updater.dmg"
@torrottum
torrottum / ItsLearning_saveasdraft_fix.css
Last active January 4, 2016 07:19
Userstyle: It's Learning "Save as draft" button fix
/*
Userstyle to "fix" the annoying save as draft button on It's Learning.
Why make it red and move it to the right?
So I don't click the stupid button unless I absolutely want to.
(It was placed where the submit button was,
and my muscle memory clicks it when I want to deliver assignments)
*/
#AnswerCtrl_FormButtons_submitbutton {