Skip to content

Instantly share code, notes, and snippets.

Avatar

David Lowry davidlowry

View GitHub Profile
@davidlowry
davidlowry / ffmpeg-minimalist-build-nvenc-static.md
Last active Feb 17, 2017
This gist will show you how to build a minimalist, statically-linked ffmpeg binary under the ~/bin subdirectory on your home on Ubuntu 16.04LTS.
View ffmpeg-minimalist-build-nvenc-static.md

Minimalist static FFmpeg build on Ubuntu 16.04 with Nvidia NVENC enabled.

Original guide with a standard build is here.

With this guide, I'm adding more instructions to enable support for NVIDIA CUVID and NVIDIA NPP for enhanced encode and decode performance.

First, prepare for the build and create the work space directory:

cd ~/
@davidlowry
davidlowry / gist:7175788
Created Oct 26, 2013
Odd behaviour from 'brew install postgres' instead of '... postgresql' Expected?
View gist:7175788
mbp:register.something david$ brew install postgres
==> Installing postgresql dependency: ossp-uuid
==> Downloading ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
^C
mbp:register.something david$ brew install postgres
==> Installing postgresql dependency: ossp-uuid
==> Downloading ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
^C
mbp:register.something david$ brew install postgres --verbose
==> Installing postgresql dependency: ossp-uuid
@davidlowry
davidlowry / ezpdf-example-with-links
Created Oct 21, 2013
Simplest ezPDF sample including links.
View ezpdf-example-with-links
@davidlowry
davidlowry / gist:6932623
Created Oct 11, 2013
Add a link to a PHP ezPDF output
View gist:6932623
$text = "To insert a link, you <c:alink:http://infinity21.net>use the <c:slink:http://infinity21.net>link text</c:slink >format";
$pdf->ezText($text,18,array('justification'=>'centre'));
@davidlowry
davidlowry / gist:4225665
Created Dec 6, 2012
Rails 3 Scopes - Show Posts With Children Only
View gist:4225665
# this gets the last five "bookings"
scope :recent, lambda {|quantity| limit(5).order('id DESC')}
# I want to only fetch bookings that are valid for purchase, i.e. they have "festival tickets" reserved for campers.
# how do I get the five latest "bookings" _that have camper tickets_?
# ref - http://stackoverflow.com/questions/8250451/rails3-scope-for-count-of-children-in-has-many-relationship
scope :with_children, joins(:campers).
@davidlowry
davidlowry / gist:3804436
Created Sep 29, 2012
VirginMedia is broken
View gist:3804436
twentyfour:g11 dave$ traceroute www.virginmedia.com
traceroute to www.virginmedia.com (212.250.162.12), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 1.151 ms 0.877 ms 0.781 ms
2 10.5.128.1 (10.5.128.1) 9.196 ms 9.534 ms 7.991 ms
3 belf-core-1b-ae2-2468.network.virginmedia.net (213.105.207.141) 12.069 ms 14.172 ms 9.615 ms
4 dubl-bb-1b-ae0-0.network.virginmedia.net (212.43.163.205) 12.367 ms 12.247 ms 11.926 ms
5 manc-bb-1b-as10-0.network.virginmedia.net (213.105.159.126) 15.737 ms 14.388 ms 13.897 ms
6 winn-bb-1a-as3-0.network.virginmedia.net (212.43.163.190) 22.198 ms 21.469 ms 20.106 ms
7 winn-dcore-1a-tenge100.network.virginmedia.net (212.43.163.134) 21.245 ms 21.111 ms 22.468 ms
8 * * *
View gist:3166259
.regular_body p img { position: relative; left: -50%; }
@davidlowry
davidlowry / Snow Leopard bug
Created Feb 25, 2011
BBC Sport Flash Player crashes in Safari Snow Leopard. URL http://news.bbc.co.uk/sport1/hi/football/football_focus/9407763.stm has plugin crash. In Chrome first play was 1.5x speed (pause, refresh, worked correctly)
View Snow Leopard bug
Process: WebKitPluginHost [7726]
Path: /System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app/Contents/MacOS/WebKitPluginHost
Identifier: com.apple.WebKit.PluginHost
Version: 6533 (6533.13)
Build Info: WebKitPluginHost-75331300~12
Code Type: X86 (Native)
Parent Process: WebKitPluginAgent [459]
PlugIn Path: /Library/Internet Plug-Ins/Flash Player.plugin/Contents/PlugIns/FlashPlayer-10.6.plugin/Contents/MacOS/FlashPlayer-10.6
PlugIn Identifier: com.macromedia.FlashPlayer-10.6.plugin
View gist:570345
#giantslive.tv
def its_saturday_night
true
end
def its_gamenight
true
end
View Wordpress XML data import with Ruby hpricot
A set of gists from my article on importing Wordpress' exported XML into a ruby application.