Skip to content

Instantly share code, notes, and snippets.

@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 / 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
@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 / 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 / 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: