Skip to content

Instantly share code, notes, and snippets.

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

Corey Goldberg cgoldberg

☠️
¯\_(ツ)_/¯
View GitHub Profile
#!/usr/bin/env python
"""Selenium WebDriver - Browser Benchmark
run 10 iterations of simple local test case with each driver:
Firefox (webdriver) vs. Chrome (chromedriver) vs. PhantomJS (ghostdriver).
"""
import unittest
@cgoldberg
cgoldberg / png_info.py
Last active December 11, 2015 20:59
utilities for analyzing PNG image files.
#!/usr/bin/env python
import struct
def get_image_info(data):
if is_png(data):
w, h = struct.unpack('>LL', data[16:24])
width = int(w)
@cgoldberg
cgoldberg / get_image_info.py
Last active August 18, 2023 02:05
validate and analyze dimensions of [PNG, JPG, GIF], image files in Python.
#!/usr/bin/env python
#
# Corey Goldberg, 2013
#
# Python 2.7
"""validate and analyze dimensions of image files. Supports: PNG, JPG, GIF."""
@cgoldberg
cgoldberg / tox.ini
Created February 11, 2013 15:01
Tox (Python) boilerplate config/ini file.
[tox]
envlist =
py26
py27
[testenv]
deps =
nose
commands =
{envpython} setup.py install
#!/usr/bin/env python
#
# Example using `concurrencytest`:
# https://github.com/cgoldberg/concurrencytest
import time
import unittest
from concurrencytest import ConcurrentTestSuite, fork_for_tests
#!/usr/bin/env python
#
# Example using `concurrencytest`:
# https://github.com/cgoldberg/concurrencytest
import unittest
from concurrencytest import ConcurrentTestSuite, fork_for_tests
@cgoldberg
cgoldberg / gource.sh
Created July 2, 2013 14:05
Gource - Mir development video
# install bzr and gource
# get a branch of Mir's trunk code
# create gource video
$ sudo apt-get install bzr gource
$ bzr branch lp:mir
$ cd mir
$ gource \
-s .06 \
@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).
@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 / 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 🍔 "