Skip to content

Instantly share code, notes, and snippets.

View kvz's full-sized avatar

Kevin van Zonneveld kvz

View GitHub Profile
"meta": {
"width": 500,
"height": 753,
"date_recorded": null,
"date_file_created": "2015/10/14 16:15:48",
"date_file_modified": "2015/11/18 13:28:12 GMT",
"title": "Terry%20Carkner",
"description": "Terry Carkner",
"location": null,
"aspect_ratio": "0.664",
#!/usr/bin/env bash
# Git Timetracker. Copyright Kevin van Zonneveld (kvz.io)
# License under MIT
#
# This file
#
# - can be run inside a git repository to get a list on what hours work took place (for billing)
# - takes 1 argument: since. It defaults to "2 months"
#
# Usage:
@kvz
kvz / gist:a566ba3be4a3faf7d6e6
Last active May 10, 2016 11:39
Proposal for (partial) template includes
{
include_template: "a", // <-- full template, used as a base
is_video: {
use: ":original",
robot: "/file/filter",
accepts: [
[
"${file.mime}",
"regex",
"video"
#!/usr/bin/env bash
# Transloadit API2. Copyright (c) 2015, Transloadit Ltd.
#
# This file
# - Reproduces the issue where resizing a certain jpg breaks
# the image on OSX & iOS, wheras the original dispays fine.
#
# Reported first by Richard Taylor in http://support.transloadit.com/discussions/questions/96479-image-conversion-problem
#
# Typically called as `./debug.sh [target.jpg]`
cd /tmp
wget -nc https://www.dropbox.com/s/04u5xws6fkvbkgb/Shred_Those_Pounds.mp4?dl=1 -O Shred_Those_Pounds.mp4
echo ""
echo ""
echo "--> Failure with '-sn -dn'"
ffmpeg-v2.2.3 \
-i ./Shred_Those_Pounds.mp4 \
-codec:a libfdk_aac \
"steps": {
"ipad": {
"robot" : "/video/encode",
"use" : [ ":original" ],
"preset": "ipad"
},
"webm": {
"robot" : "/video/encode",
"use" : [ ":original" ],
"preset": "webm"
@kvz
kvz / strace-identify-list-delegate.sh
Last active August 29, 2015 13:57
When I run `identify -list delegate` it shows my delegates, but then exits with "Aborted (core dumped)"
# I statically compiled Imagemagick.
# Converting works well so far.
# But when I run `identify -list delegate` it shows my delegates, but then exits with "Aborted (core dumped)".
# What could be wrong here?
$ strace -f identify -list delegate
execve("./target/bin/identify", ["identify", "-list", "delegate"], [/* 21 vars */]) = 0
brk(0) = 0x34e2000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8452cd8000
#!/usr/bin/env bash
#
# A Git pre-commit hook that checks for syntax errors
# for: Ruby, JavaScript, Python, Bash, and (Cake)PHP
# based on the extensions of staged files in Git.
# Can be 'installed globally' as of Git 1.7.1 using init.templatedir
#
# Copyright 2013, kvz (http://twitter.com/kvz)
#
# Some common caveats have been taken care of:
ubuntu@beth:/tmp$ time dig @4.2.2.2 +time=3 +tries=1 +short tmp.transloadit.com.s3.amazonaws.com
s3-1-w.amazonaws.com.
205.251.243.73
real 0m0.079s
user 0m0.004s
sys 0m0.000s
ubuntu@beth:/tmp$ time dig @8.8.8.8 +time=3 +tries=1 +short tmp.transloadit.com.s3.amazonaws.com
;; connection timed out; no servers could be reached