Skip to content

Instantly share code, notes, and snippets.

View adfinlay's full-sized avatar

Andrew Finlay adfinlay

View GitHub Profile
@adfinlay
adfinlay / moviebarcode.py
Created November 30, 2016 15:50 — forked from ata4/moviebarcode.py
Python script to create movie barcodes with ffmpeg and imagemagick
#!/usr/bin/python
import sys, subprocess, getopt, os, json
def main(argv):
script_name = os.path.basename(argv[0])
try:
opts, args = getopt.getopt(argv[1:], "sw:h:q:", ["help", "solid-color", "width=", "height=", "samples="])
except getopt.GetoptError as err:
@adfinlay
adfinlay / uri.js
Last active August 29, 2015 14:23 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
backend jsonp_varnish {
.host = "localhost";
.port = "80";
}
#------------- begin jsonp functionality -------------#
# How the jsonp_template_backend dispatches to the ESI generating code:
sub jsonp_throw_error_recv {
if (req.url == "/JSONP-ESI-TEMPLATE") {
error 760;
colorscheme:symfony
cs_re:yellow:"[^"\\]*(\\.[^"\\]*)*"
cs_re:cyan:^\[....-..-.. ..:..:..\]
cs_re:green:.*DEBUG.*
cs_re:red:^.*(WARNING|ERROR|CRITICAL).*$
cs_re:blue:.*INFO.*
<?php
class FeatureContext extends MinkContext {
/**
* Take screenshot when step fails. Works only with Selenium2Driver.
* Screenshot is saved at [Date]/[Feature]/[Scenario]/[Step].jpg
*
* @AfterStep
*/
#!/bin/bash
# Disclaimer - make backups, use at your own risk.
#
# Based on this comment: http://stackoverflow.com/a/13944924/843067
# Views and stored procedures have to be done separately.
OLDDB="old_db_name"
NEWDB="new_db_name"
MYSQL="mysql -u root -pyour_password "