Skip to content

Instantly share code, notes, and snippets.

@jeorgen
jeorgen / alignment_by_row_channels.py
Last active August 29, 2015 14:19
This is a straight copy of Allison Deal's alignment_by_row_channels.py. https://github.com/allisonnicoledeal/VideoSync/blob/master/alignment_by_row_channels.py I'm just putting it here in case the repository it's in gets deleted. It aligns two video files by syncing audio.
import scipy.io.wavfile
import numpy as np
from subprocess import call
import math
# Extract audio from video file, save as wav auido file
# INPUT: Video file
# OUTPUT: Does not return any values, but saves audio as wav file
def extract_audio(dir, video_file):
import os
from psycopg2.pool import ThreadedConnectionPool
class ProcessSafePoolManager:
def __init__(self, *args, **kwargs):
self.last_seen_process_id = os.getpid()
self.args = args
self.kwargs = kwargs
@jeorgen
jeorgen / livevalidation-jquery.html
Created September 29, 2012 12:32
This page demonstrates how Livevalidation "hangs on" to elements that have been removed by jquery
<html>
<!--This page demonstrates how Livevalidation "hangs on" to elements that have been removed by jquery.
Usage: Open the page in a web browser (I have used Chrome 22.0.1229.64 beta and Firefox 15.0 on Linux)
Attach a validator to the e-mail field by clicking the "Add validator" link.
Remove the e-mail field by clicking the "Remove e-mail" link.
The form cannot be submitted.
A workaround is to let livevalidation explicitly destroy the field-->