Skip to content

Instantly share code, notes, and snippets.

View Svenito's full-sized avatar

Sven Steinbauer Svenito

View GitHub Profile
$> brew install -v field3d 2>&1
==> Downloading https://github.com/imageworks/Field3D/archive/v1.3.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/field3d-1.3.2.tar.gz
==> Verifying field3d-1.3.2.tar.gz checksum
tar xf /Library/Caches/Homebrew/field3d-1.3.2.tar.gz
==> Patching
patching file CMakeLists.txt
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/field3d/1.3.2 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DDOXYGEN_EXECUTABLE=NOTFOUND ..
-- The C compiler identification is Clang 5.1.0
-- The CXX compiler identification is Clang 5.1.0
@Svenito
Svenito / houchangelog.py
Created April 18, 2013 10:14
Script gets the changes between two build versions of Houdini from the journal and outputs them in a more traditional changelog format. Be sensible with how much data you want to get! Requires the Beautiful soup and requests libraries
#!/usr/bin/env python2.7
from BeautifulSoup import BeautifulSoup
from textwrap import TextWrapper
import requests
import collections
import sys
import re
@Svenito
Svenito / retio.py
Last active December 11, 2015 13:28
Plot the ratio of up/down votes of reddit subreddits in a box plot (https://en.wikipedia.org/wiki/Box_plot) To use call with subreddit names: ./retio.py funny pics programming python Requires matplotlib
#!/usr/bin/python
import simplejson
import urllib
import sys
import time
import pylab
import matplotlib.pyplot as plt
def getRatios(subreddit):
@Svenito
Svenito / getband.py
Created November 6, 2012 14:57
Create a random album cover
#!/usr/bin/env python2.6
import urllib
from xml.dom import minidom
from optparse import OptionParser
import subprocess
import re
from HTMLParser import HTMLParser
import random
@Svenito
Svenito / ImagePlayer.py
Created November 2, 2012 10:28
Python class to play an animated gif using PyQt
class ImagePlayer(QWidget):
def __init__(self, filename, title, parent=None):
QWidget.__init__(self, parent)
# Load the file into a QMovie
self.movie = QMovie(filename, QByteArray(), self)
size = self.movie.scaledSize()
self.setGeometry(200, 200, size.width(), size.height())
self.setWindowTitle(title)
@Svenito
Svenito / getalbum.py
Created October 15, 2012 09:59
Random Album Generator
#!/usr/bin/env python2.6
import urllib
from xml.dom import minidom
from optparse import OptionParser
import subprocess
import re
from HTMLParser import HTMLParser
import random
@Svenito
Svenito / getimage.py
Created October 11, 2012 13:58
Parse email for image URL and process
#!/usr/local/bin/python
import subprocess
import fileinput
import email
import re
def extract_body(payload):
if isinstance(payload,str):
return payload
@Svenito
Svenito / weatherdesktop.py
Created June 28, 2012 08:31
Weather desktop
#!/usr/bin/python
import sys
import pywapi
import subprocess
img_path = "/path/to/img/weather/"
weather_img = {}
weather_img['Partly Sunny'] = img_path + "part_sun.jpg"
weather_img['Scattered Thunderstorms'] = img_path + "thunder.jpg"
@Svenito
Svenito / tube.py
Created June 7, 2012 10:52
Get the London tube status on your CLI & Conky
#!/usr/bin/env python2.6
import urllib
from xml.dom import minidom
from optparse import OptionParser
status_url = "http://api.tubeupdates.com/?method=get.status&lines=%s&format=xml"
def main(lines, show_message):
url = status_url % ','.join(lines)