Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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_octostrap_code_blocks.html
Created July 11, 2014 14:38
Sphinx vs Octopress/Octostrap code blocks - A comparison of Sphinx output and Octopress/Octostrap output
Sphinx:
Marked code is surrounded by <span class="hll"></span>
Octopress:
Marked code is surrounded by <span class="line marked"><span>
(Start lines have additional class of "start", end lines have "end"
Non-line numbered Code:
@shidarin
shidarin / instagram_list.py
Last active August 29, 2015 14:08
Alphabetize bbcode artist list
#!/usr/bin/python
from re import search
ig_string = """
1000Styles - http://instagram.com/1000styles
123 Klan - http://instagram.com/123klan
Aa - http://instagram.com/aestheticapparatus
Aaron Martin (Angrywoebots) - http://instagram.com/woes
Aec (Interesni Kazki) - http://instagram.com/aec_interesnikazki
Andrews, Esao - http://instagram.com/esao
@shidarin
shidarin / expanse_giveaway_script.py
Last active August 29, 2015 14:25
Script used to read a quiz results for /r/TheExpanse in CSV and grade, then select winners.
#!/usr/bin/python
"""Script used to read a quiz results CSV and grade, then select winners."""
#==============================================================================
# IMPORTS
#==============================================================================
import csv
from datetime import datetime
import random
Alethkar:expanse sean$ ls
expanse.py expanse_responses.csv
Alethkar:expanse sean$ python expanse.py expanse_responses.csv
Invalid entry: Shidarin is not allowed to enter.
Invalid entry: User HwoThumb is not over 18!
Invalid entry: User Cannessian has entered more than once! Only the first will be counted.
Invalid entry: User Cannessian has entered more than once! Only the first will be counted.
Invalid entry: User Cannessian has entered more than once! Only the first will be counted.
Invalid entry: Shidarin is not allowed to enter.
@shidarin
shidarin / make_m3u.py
Created August 2, 2015 19:49
m3u playlist generator to help with retroarch emulator setup and multiple disks
#!/usr/bin/python
"""This script will create an m3u file with a tracklist of each .cue or .ccd
found in a subdirectory, then name the m3u after the subdirectory. This helps
with multiple disks for emulation.
"""
import os
import os.path
@shidarin
shidarin / windows_python_path.md
Created August 4, 2015 18:31
How to add python and python's scripts folder to window's PATH

Need to add Python’s bin folder to Window’s $PATH, otherwise it can’t run installers correctly.

  1. Windows Button + Pause Button (AKA Break Button, AKA F15)
  2. Click Advanced Settings
  3. Click Environment Variables
  4. Append ;C:\python27;C:\python27\Scripts to the Path Variable