Skip to content

Instantly share code, notes, and snippets.

View cgoldberg's full-sized avatar
👋
¯\_(ツ)_/¯

Corey Goldberg cgoldberg

👋
¯\_(ツ)_/¯
View GitHub Profile
@cgoldberg
cgoldberg / testtools_add_details.py
Created July 7, 2014 16:25
testtools - adding test details (content objects) to your tests
#!/usr/bin/env python3
#
# This example adds testtools Details from a testtools TestCase.
#
# For more information about: testtools, Details, and Content Objects, visit:
# * https://testtools.readthedocs.org/en/latest/for-test-authors.html#details
from testtools import TestCase
from testtools.content import (
ContentType,
@cgoldberg
cgoldberg / subunit_save_details.py
Last active August 29, 2015 14:02
subunit - save arbitrary test result details to files
#!/usr/bin/env python3
import logging
import re
from subunit import ByteStreamToStreamResult
from testtools import StreamToExtendedDecorator, TestResult
logging.basicConfig(level='INFO')
@cgoldberg
cgoldberg / helloworld_pyqt5.py
Last active January 27, 2019 20:43
Hello World, in Python3 and Qt5
#!/usr/bin/env python3
"""
helloworld.py
Python3 and Qt5
"""
from PyQt5 import QtWidgets
@cgoldberg
cgoldberg / img_metadata_strip_fix.py
Last active July 18, 2019 09:03
Python - image metadata remover and date fixer.
#!/usr/bin/env python
#
# image metadata remover and date fixer.
# Corey Goldberg, 2014
"""Recursively scan a directory tree for image files, and fix metadata.
* removes all metadata (Exif, IPTC, XMP, GPS Info, comment, thumbnail)
* sets metadata and file timestamps to oldest datetime found.
@cgoldberg
cgoldberg / img_exif_date_fixer.py
Last active June 7, 2021 07:10
Python - Fix Photo Exif Metadata
#!/usr/bin/env python
#
# gexiv2 image Exif date fixer.
# Corey Goldberg, 2014
"""Recursively scan a directory tree, fixing dates
on all jpg/png image files.
Each file's Exif metadata and atime/mtime are all
@cgoldberg
cgoldberg / gource-ubuntu-core-apps.sh
Last active December 28, 2015 14:39
Generate gource video out of bzr repositories for Ubuntu Touch Core Apps.
#!/usr/bin/env bash
# Generate gource video out of bzr repositories for Ubuntu Touch Core Apps.
#
# Corey Goldberg 2013
#
# Usage:
# gource-ubuntu-core-apps.sh /path/to/repo1 /path/to/repo2
#
# Example - generate video for all Ubuntu Touch Core Apps:
@cgoldberg
cgoldberg / gource-multiple-repositories.sh
Last active May 22, 2024 12:53 — forked from derEremit/gource-multiple-repositories.sh
Generates gource video of multiple source code repositories.
#!/usr/bin/env bash
# Generates gource video out of multiple repositories.
# First, get a local branch/clone of each repository.
# Then, pass the repositories as command line arguments.
#
# Example:
# $ gource-multiple-repositories.sh /path/to/repo1 /path/to/repo2
@cgoldberg
cgoldberg / hamburger_bash_shell_prompt_ubuntu.txt
Last active December 22, 2015 11:38
hamburger bash shell-prompt
hamburger bash shell-prompt!
http://boingboing.net/2013/04/03/howto-turn-your-shell-prompt-i.html
to do this on Ubuntu:
- open terminal:
- $ sudo apt-get install ttf-ancient-fonts
- $ export PS1="\\u@\h \\w 🍔 "
@cgoldberg
cgoldberg / xbmc.sh
Created August 31, 2013 14:33
launch XBMC one one screen in fullscreen mode, in multi-monitor setup.
#!/bin/bash
# Launch XBMC in windowed mode, then use wmctrl to remove the titlebar
# Select display 1
DISPLAY=:0.0
# Start XBMC without blocking this script
xbmc &
# Wait for the XBMC window to appear
@cgoldberg
cgoldberg / lookup_pypi_packages.py
Last active September 15, 2020 21:53
lookup PyPI packages by author or maintainer
#!/usr/bin/env python
# Corey Goldberg, 2013
import argparse
import pkgtools.pypi
"""
Command line script to lookup packages on Python Package Index (PyPI).