Skip to content

Instantly share code, notes, and snippets.

View davidlatwe's full-sized avatar
:shipit:
Awesome

David Lai davidlatwe

:shipit:
Awesome
View GitHub Profile
@dbr
dbr / nuke_dot_arrange.py
Created October 1, 2011 08:44
Using graphviz's "dot" to arrange a Nuke node graph
"""Test of using graphviz's "dot" layout algorithm to arrange a Nuke node-graph
Example: http://i.imgur.com/f1mK7.png
Left is dot, right is Nuke's builtin nuke.autoplace
"""
import nuke
# http://code.google.com/p/pydot/
import pydot
@KelSolaar
KelSolaar / mayaWidgetEmbeddingIntoPyQtWidget.py
Created November 3, 2011 17:33
Maya Widget Embedding Into PyQt Widget
import maya.OpenMayaUI
import maya.cmds as cmds
import sip
from PyQt4.QtGui import *
from PyQt4.QtCore import *
mainWindow = QMainWindow()
centralWidget = QListView()
mainWindow.setCentralWidget(centralWidget)
dockWidget = QDockWidget("DockWidget", mainWindow)
@schworer
schworer / undo_dec.py
Created February 22, 2012 17:57
quick and dirty Maya Python undo decorator
from functools import wraps
from maya import cmds
def undo(func):
""" Puts the wrapped `func` into a single Maya Undo action, then
undoes it when the function enters the finally: block """
@wraps(func)
def _undofunc(*args, **kwargs):
try:
# start an undo chunk
@johnpneumann
johnpneumann / houdini_clip_creator.py
Created April 2, 2012 19:50
Write out clip file for Houdini from Maya
"""
@author:
John P. Neumann (aka ArrantSquid)
@description:
Writes out a clip file (for use in Houdini) based on maya attributes
passed in.
@usage:
main('some_object', ['scaleX','visibility'], 'some_dir')
@digitaljhelms
digitaljhelms / gist:4287848
Last active August 27, 2025 13:40
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@justinfx
justinfx / flash_text.py
Last active December 19, 2022 01:53
An example of how to flash the color of the text of a QLabel in PySide or PyQt4. Uses QPropertyAnimation with a custom setColor property.
from PySide import QtCore, QtGui
class Widget(QtGui.QWidget):
def __init__(self):
super(Widget, self).__init__()
self.resize(300,200)
layout = QtGui.QVBoxLayout(self)
@andreif
andreif / daemon.md
Last active May 8, 2024 00:17
A simple unix/linux daemon in Python

A simple unix/linux daemon in Python

Source: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

Access: http://web.archive.org/web/20131025230048/http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

by Sander Marechal

I've written a simple Python class for creating daemons on unix/linux systems. It was pieced together for various other examples, mostly corrections to various Python Cookbook articles and a couple of examples posted to the Python mailing lists. It has support for a pidfile to keep track of the process. I hope it's useful to someone.

@mottosso
mottosso / README.md
Last active May 27, 2020 07:16
QObject list-model with factory function
@mottosso
mottosso / README.md
Last active February 3, 2020 10:54
QObject list-model with defaults

QObject list-model with defaults

In addition to declarative syntax, default values are stored in each subclass from which type is derived.

>>> class Item(AbstractItem):
...   name = "default name"
...   age = 10
...   alive = True
...
@angstwad
angstwad / dict_merge.py
Last active December 22, 2024 16:02
Recursive dictionary merge in Python
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct