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 / selenium_webdriver_phantomjs.py
Created Jan 7, 2013
Python unit test using PhantomJS and Selenium WebDriver. Headless web acceptance testing.
View selenium_webdriver_phantomjs.py
#!/usr/bin/env python
"""Python unit test using PhantomJS and Selenium WebDriver."""
# requires: selenium python bindings, phantomjs 1.8+
#
# if you have phantomjs installed and on your PATH,
# you can instantiate a PhantomJS WebDriver like this:
#
# from selenium import webdriver
View selenium_browser_benchmark.py
#!/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 Dec 11, 2015
utilities for analyzing PNG image files.
View png_info.py
#!/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 / tox.ini
Created Feb 11, 2013
Tox (Python) boilerplate config/ini file.
View tox.ini
[tox]
envlist =
py26
py27
[testenv]
deps =
nose
commands =
{envpython} setup.py install
View concurrencytest_example_1.py
#!/usr/bin/env python
#
# Example using `concurrencytest`:
# https://github.com/cgoldberg/concurrencytest
import time
import unittest
from concurrencytest import ConcurrentTestSuite, fork_for_tests
View concurrencytest_example_2.py
#!/usr/bin/env python
#
# Example using `concurrencytest`:
# https://github.com/cgoldberg/concurrencytest
import unittest
from concurrencytest import ConcurrentTestSuite, fork_for_tests
@cgoldberg
cgoldberg / xbmc.sh
Created Aug 31, 2013
launch XBMC one one screen in fullscreen mode, in multi-monitor setup.
View xbmc.sh
#!/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
View hamburger_bash_shell_prompt_ubuntu.txt
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 / 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 / lookup_pypi_packages.py
Last active Mar 13, 2017
lookup PyPI packages by author or maintainer
View lookup_pypi_packages.py
#!/usr/bin/env python
# Corey Goldberg, 2013
import argparse
import pkgtools.pypi
"""
Command line script to lookup packages on Python Package Index (PyPI).
You can’t perform that action at this time.