Skip to content

Instantly share code, notes, and snippets.

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

Corey Goldberg cgoldberg

☠️
¯\_(ツ)_/¯
View GitHub Profile
@cgoldberg
cgoldberg / gource-multiple-repositories.sh
Last active March 25, 2024 19:35 — 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 / 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 / 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 / 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 / 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 / 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 / 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 / metric_to_graphite.js
Last active July 20, 2023 10:12
send metric data to hosted graphite via HTTP POST.
/* send a metric to hosted graphite via HTTP POST (async). */
function sendMetricToGraphite(metricName, value) {
var apiKey = YOUR-API-KEY;
var url = "https://" + apiKey + "@www.hostedgraphite.com/api/v1/sink";
var request = new XMLHttpRequest();
request.open("POST", url, true);
request.send(metricName + " " + value);
};
@cgoldberg
cgoldberg / parse-onloads.py
Created April 9, 2015 18:34
analyze top slowest pages using onload event beacon data
#!/usr/bin/env python
import collections
import re
from operator import itemgetter
import numpy
DATA_FILE = 'perflog-everything-onload.csv'
NUM_RESULTS = 50
@cgoldberg
cgoldberg / mhtest.py
Created April 14, 2015 15:01
parse onload timings and weight with Cochran–Mantel–Haenszel
#!/usr/bin/env python
import collections
import re
from operator import itemgetter
import urlparse
import numpy
import sys