Skip to content

Instantly share code, notes, and snippets.

@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
@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 / movie_cleanup.py
Last active February 19, 2017 05:43
Duplicates poster.jpg with {title}-poster.jpg and other movie folder cleanup
#!/usr/bin/env python
import logging
import os
import re
import shutil
MOVIES = '/mnt/media/Videos/Movies'
MOVIE_NAME = re.compile(r'(^.*?) \(\d{4}\)$')
@shidarin
shidarin / expressocash.py
Last active February 4, 2017 18:43
Auto build for sale posts for posters from ExpressoBeans.
#!/usr/bin/env python
"""Auto build for sale posts for posters from ExpressoBeans.
Save your Trades page as an HTML file, and put the file location
you saved it at in FILE_PATH below. Right now this will only work on one
page of trades, so if you're selling a billion items this won't
work for you.
At the bottom of the script, put markdown(), facebook() or bbcode()
depending on where you are posting the posters.
@shidarin
shidarin / imgurAlbum.py
Last active March 30, 2016 11:12
Imgur Album to phpbb forum thumbnail link markdown
import requests
import bs4
def _trim(string, trim_extra=False):
if trim_extra:
trim_length = -5
else:
trim_length = -4
return string[:trim_length]
@shidarin
shidarin / ftp_match_dl.py
Last active March 5, 2016 15:19
Used for downloading emulation movie 'snaps' from emumovies.com
#!/usr/bin/python
"""Tool for downloading matching movie files for a rom collection."""
from __future__ import absolute_import, division, print_function
from argparse import ArgumentParser
import ConfigParser
import ftplib
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
@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
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 / 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