Skip to content

Instantly share code, notes, and snippets.

@andrewbunday
andrewbunday / .SciteUser.properties
Created June 28, 2011 11:51
My current scite properties. Seriously messed up and not for the faint of heart
line.margin.width=1+
line.margin.visible=1
view.python.whitespace=1
view.eol=0
# Indentation
tabsize=4
indent.size=4
use.tabs=0
indent.auto=1
@andrewbunday
andrewbunday / install_nvidia-current.py
Created July 6, 2011 10:41
Replacing Jockey-text with a few short lines of simplified python
#!/usr/bin/env python
import apt
import subprocess
#import fnctrl <-- filelock on modprobe blacklists...
#import XKit.xutils <-- xorg.conf file editing
driver = "nvidia-current"
xorg_conf_path = "/etc/X11/xorg.conf"
@andrewbunday
andrewbunday / run_stages.pp
Created July 7, 2011 16:33
Is there any way to specify the run stage for a puppet class I wish to include in several other classes?
Question:
Is there a way to make myclass run before my other
classes without defining explicit relationships?
==================================================
site.pp:
stage{ 'first': }
@andrewbunday
andrewbunday / cdl2ccc.py
Created August 19, 2011 15:40
A Simple extractor to parse a valid xml based CDL and convert it into a simplified ColorCorrectionCollection xml file.
#!/usr/bin/env python
#
# Author: Andrew Bunday
# Date: 19/08/11
#
# A Simple extractor to parse a valid xml based CDL and convert it into
# a simplified ColorCorrectionCollection xml file.
import xml.etree.ElementTree
from xml.etree.ElementTree import XMLParser, ElementTree, Element
@andrewbunday
andrewbunday / test_json.py
Created October 11, 2011 14:29
I got annoyed the other day when I kept editing mission critical json based config files and had no way of knowing if the files were syntactically correct.
#!/usr/bin/env python
import json
import sys
checkedfiles={'good':[], 'bad':[]}
if len(sys.argv) > 1:
for arg in sys.argv[1:]:
try:
@andrewbunday
andrewbunday / gist:1358794
Created November 11, 2011 18:30
Greenlet based PyQt and Flask application
#!/usr/bin/env python
import sys
import time
from flask import Flask
from PyQt4 import QtCore, QtGui, QtWebKit
import gevent.wsgi
@andrewbunday
andrewbunday / userSetup.py
Created December 7, 2011 18:31
This kinda thing really gets on my wick. Sometimes a plugin comes along which doesn't source it's own shelves. When that happens you have to hunt around in the file system to load the shelf. So instead popping this file into the scripts directory of the p
import maya
def bbLoadShelf(name, filepath=""):
mainShelfLayout = maya.mel.eval('global string $gShelfTopLevel; string $tmp=$gShelfTopLevel;')
labels = maya.cmds.tabLayout(mainShelfLayout, query=True, tabLabel=True)
if not name in labels:
maya.mel.eval('addNewShelfTab "%s"' % name)
maya.utils.executeDeferred( bbLoadShelf('MyPlugin')
@andrewbunday
andrewbunday / compressor.py
Created March 1, 2012 16:48
This is how little I trust Compressor's Command Line Interface.
#!/usr/bin/env python
"""
Compressor wrapper script.
"""
import os
import sys
import re
import argparse
import subprocess
import logging
@andrewbunday
andrewbunday / versions.cfg
Created March 16, 2012 16:29
Development Version Names
Ambient
Bluegrass
Classical
Dubstep
Electro
Funk
Garage
HipHop
Indie
Jazz
@andrewbunday
andrewbunday / toggleAnamorphic.mu
Created March 20, 2012 12:55
Toggle anamorphic unsqueeze in RV
module: bb_setup {
use rvtypes;
use rvui;
use commands;
use app_utils;
use extra_commands;
documentation: """
BaseblackMinorMode adds keybindings and other funky stuff like that to the
session.