Skip to content

Instantly share code, notes, and snippets.

@shidarin
shidarin / sphinx_style_tests.rst
Last active August 29, 2015 14:03
Sphinx Style Test Page - Rst for testing a whole bunch of Sphinx styles. Useful for developing convertors.

Testing

This rst file is for testing the various Sphinx styles and class conversions that we'll find in a Sphinx rst file. Ideally we want to run through everything pretty often.

The first tests

@shidarin
shidarin / sphinx_bootstrap_docutils.py
Last active August 29, 2015 14:03
Sphinx Docutils Bootstrap Directives - Directives for some common Sphinx paragraph types
from docutils import nodes
from docutils.parsers.rst import directives, Directive
PARAGRAPH_CODE = """
<div class="panel {panel_type}">
<div class="panel-heading">
<h3 class="panel-title">{panel_title}</h3>
</div>
<div class="panel-body">
<p class="panel-text">{panel_content}</p>
@shidarin
shidarin / pytline0.2.1_C0330.py
Last active August 29, 2015 14:01
Hanging Indent Issues with PyLint 0.2.1
import argparse
def parse_args():
parser = argparse.ArgumentParser()
# No trigger
parser.add_argument(
"no indent",
help="this isn't going to have an indent"
)
@shidarin
shidarin / smpte_timecode_segment.py
Last active June 5, 2018 20:05
Constructs an SMPTE timecode segment with in, out and duration. Timecode in can be provided or generated randomly. 100% Coverage Tests included.
#/usr/bin/python
# SMPTE TimeCode Segement
# By Sean Wallitsch, 2014/04/19
"""
Contains a TimeCodeSegment class that allows input of SMPTE hours,
minutes, seconds, frames, fps and desired duration.
The class will then contain a start, end, and duration SMPTE
timecode values, stored as strings such as:
'12:23:15:10'
@shidarin
shidarin / constantDraw.py
Last active August 29, 2015 13:59 — forked from sean-c-johnston/constantDraw.py
Fork of https://gist.github.com/SurpriseTRex/10633830 showing some further revisions possible. Original description: Nuke script. Down-rezzes and re-draws the selected read node in the Node Graph, using Constant nodes as pixels. Accounts for aspect ratio. More than 20x20 not recommended for performance reasons.
__author__ = 'SurpriseTRex'
def draw_constant(res=10):
"""Re-draws a Read node using Constant nodes as pixels."""
# Checks that the user has selected a Read node.
try:
node = nuke.selectedNode()
except ValueError:
@shidarin
shidarin / luts.py
Last active June 13, 2018 16:07
Controlling Nuke Lut Behavior
# =============================================================================
# Controlling Nuke Lut Behavior
# =============================================================================
# From: Controlling Nuke Lut Behavior
# http://shidarin.github.io/2013/controlling-nuke-lut-behavior/
# By: Sean Wallitsch (sean@grenadehop.com)
# =============================================================================
"""Functions for creating LUT groups to be used as ViewerProcesses within Nuke
Synopsis