Skip to content

Instantly share code, notes, and snippets.

@andycodes00
andycodes00 / .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
@andycodes00
andycodes00 / 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"
@andycodes00
andycodes00 / 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': }
@andycodes00
andycodes00 / 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:
@andycodes00
andycodes00 / 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
@andycodes00
andycodes00 / 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')
@andycodes00
andycodes00 / 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
@andycodes00
andycodes00 / versions.cfg
Created March 16, 2012 16:29
Development Version Names
Ambient
Bluegrass
Classical
Dubstep
Electro
Funk
Garage
HipHop
Indie
Jazz
@andycodes00
andycodes00 / 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.
@andycodes00
andycodes00 / motd
Created November 13, 2012 09:48
hostname in motd
|^ | ~|~ ( |-| ]3 |_ /\ ( /<
___ ,---, ,--,
,-.----. ,--, ,--.'|_ ,--.' | ,---, ,--.'|
\ / \ ,--.'| | | :,' | | : ,---,.,---.'| | | :
| : || |, : : ' : : : : ,' .' || | : : : '
| | .\ :`--'_ .;__,' / ,---. : | |,--.,---.' ,: : : | ' |
. : |: |,' ,'| | | | / \ | : ' || | |: |,-.' | |