Skip to content

Instantly share code, notes, and snippets.

View jbuchbinder's full-sized avatar

Jeff Buchbinder jbuchbinder

View GitHub Profile
@jbuchbinder
jbuchbinder / phantom-load.js
Created April 1, 2016 14:03
PhantomJS page load timer
// @jbuchbinder
//
// Execute with:
// phantomjs --ssl-protocol=TLSv1 phantom-load.js URL
"use strict";
var page = require('webpage').create(),
system = require('system'),
address;
@jbuchbinder
jbuchbinder / resourcetiming.js
Created April 1, 2016 13:36 — forked from oloynet/resourcetiming.js
Catch all the resource load times with casperjs
var casper = require("casper").create({
//loadImages: false,
//logLevel: 'debug',
verbose: true
});
var utils = require('utils');
/* ----- test parameters ----- */
@jbuchbinder
jbuchbinder / notes-to-pdf.sh
Created February 8, 2016 14:39
Use markdown-pdf to convert meeting notes/minutes in Markdown into nicely formatted PDF documents.
#!/bin/bash
#
# notes-to-pdf.sh
# @jbuchbinder
#
# Use markdown-pdf to convert meeting notes/minutes in Markdown into nicely formatted
# PDF documents. Formatting:
#
# # Title
# ## Subtitle
@jbuchbinder
jbuchbinder / concat-mts-files.sh
Created February 8, 2016 14:19
Concatenate MTS AVCHD files under Linux
#!/bin/bash
## Solution from: http://stackoverflow.com/questions/26150533/join-avchd-mts-files-on-linux
## ffmpeg -i "concat:00000.MTS|00001.MTS|00002.MTS" -c copy output.m2ts
## File with .m2ts extension, etc
OUT="$1"; shift
## Format : "concat:00000.MTS|00001.MTS|00002.MTS"
IN="concat:$1"; shift
@jbuchbinder
jbuchbinder / contact-sheets.sh
Last active November 27, 2017 16:13
Create contact sheets from CR2 and JPG photos
#!/bin/bash
# Create 7x6 contact sheets
# @jbuchbinder
#
# Dependencies:
# - dcraw
# - imagemagick
SIZE=500
@jbuchbinder
jbuchbinder / coffee.go
Created December 17, 2015 13:54
Coffee.
package main
import "vendor/coffee"
func main() {
cup, err := coffee.NewCoffee()
if err != nil {
panic()
}
for {
@jbuchbinder
jbuchbinder / normalizing-video-volume.sh
Created November 13, 2015 01:13
Normalizing video volume
VIDEO_FILE=$1
VIDEO_FILE_FIXED=${VIDEO_FILE%.*}-fixed.${VIDEO_FILE##*.}
avconv -i $VIDEO_FILE -c:a pcm_s16le -vn audio.wav
normalize-audio audio.wav
avconv -i $VIDEO_FILE -i audio.wav -map 0:0 -map 1:0 -c:v copy -c:a libvo_aacenc $VIDEO_FILE_FIXED
@jbuchbinder
jbuchbinder / GoPro-Timelapse.sh
Last active October 12, 2015 19:04
GoPro timelapse assembly
## Assemble timelapse into AVI
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 \
-vf scale=1920:1080 -mf type=jpeg:fps=23.97 'mf://*.JPG' \
-o out.avi
## Convert to MP4
HandBrakeCLI -Z Normal -O4 -i out.avi -o out.mp4
## Concatenate into a single file
MP4Box -cat out1.mp4 -cat out2.mp4 -new out-combined.mp4
@jbuchbinder
jbuchbinder / fix-aspect-ratio.sh
Created September 25, 2015 13:02
ffmpeg snippet to fix aspect ratio in MP4 files
ffmpeg -i input.mp4 -vcodec copy -acodec copy -aspect 3:2 output.mp4
#!/bin/bash
for FC in $*; do
DLCODE=$( wget -O - -q "http://thevideo.me/cgi-bin/index_dl.cgi?op=get_vid_versions&file_code=$FC" | grep "Normal quality" | cut -d'"' -f6 )
LANDINGURL="http://thevideo.me/download/$( echo $DLCODE | cut -d\' -f2 )/$( echo $DLCODE | cut -d\' -f4 )/$( echo $DLCODE | cut -d\' -f6 )"
wget -O /dev/null -q "$LANDINGURL"
sleep 2
wget -c $( curl -s -X POST -d "op=download_orig&id=${FC}&hash=$( echo $DLCODE | cut -d\' -f6 )" "$LANDINGURL" | grep btn_download | cut -d'"' -f2 )
done