Skip to content

Instantly share code, notes, and snippets.

☠️
¯\_(ツ)_/¯

Corey Goldberg cgoldberg

☠️
¯\_(ツ)_/¯
Block or report user

Report or block cgoldberg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cgoldberg
cgoldberg / mhtest.py
Created Apr 14, 2015
parse onload timings and weight with Cochran–Mantel–Haenszel
View mhtest.py
#!/usr/bin/env python
import collections
import re
from operator import itemgetter
import urlparse
import numpy
import sys
@cgoldberg
cgoldberg / parse-onloads.py
Created Apr 9, 2015
analyze top slowest pages using onload event beacon data
View parse-onloads.py
#!/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 / metric_to_graphite.js
Last active May 18, 2018
send metric data to hosted graphite via HTTP POST.
View metric_to_graphite.js
/* 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 / testtools_add_details.py
Created Jul 7, 2014
testtools - adding test details (content objects) to your tests
View testtools_add_details.py
#!/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 Aug 29, 2015
subunit - save arbitrary test result details to files
View subunit_save_details.py
#!/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 Jan 27, 2019
Hello World, in Python3 and Qt5
View helloworld_pyqt5.py
#!/usr/bin/env python3
"""
helloworld.py
Python3 and Qt5
"""
from PyQt5 import QtWidgets
@cgoldberg
cgoldberg / img_metadata_strip_fix.py
Last active Jul 18, 2019
Python - image metadata remover and date fixer.
View img_metadata_strip_fix.py
#!/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 Oct 30, 2017
Python - Fix Photo Exif Metadata
View img_exif_date_fixer.py
#!/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 Dec 28, 2015
Generate gource video out of bzr repositories for Ubuntu Touch Core Apps.
View gource-ubuntu-core-apps.sh
#!/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 3, 2018 — forked from derEremit/gource-multiple-repositories.sh
Generates gource video of multiple source code repositories.
View gource-multiple-repositories.sh
#!/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
You can’t perform that action at this time.