Skip to content

Instantly share code, notes, and snippets.

View eddhannay's full-sized avatar
Defunct, see @edd

Moved to @edd eddhannay

Defunct, see @edd
View GitHub Profile
@eddhannay
eddhannay / tools.sh
Created February 11, 2017 15:07
Using webpagetest to benchmark adblocking on a site
# Download & reformat ad servers to block (from http://pgl.yoyo.org/adservers/)
curl 'http://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml&showintro=1&startdate%5Bday%5D=&startdate%5Bmonth%5D=&startdate%5Byear%5D=' | tr '\r\n' ' ' > urls-to-block.txt
# Also useful: combine two videos (thanks: http://ianfeather.co.uk/compare-two-webpagetest-videos-using-ffmpeg/)
ffmpeg -i no-blocking.mp4 -i blocking.mp4 -filter_complex "[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w" output.mp4tool
@eddhannay
eddhannay / gist:11223174
Last active December 12, 2017 22:59
keybase.md
### Keybase proof
I hereby claim:
* I am eddhannay on github.
* I am eddhannay (https://keybase.io/eddhannay) on keybase.
* I have a public key ASBnXYKHphua5jJ6boJSwjDbtmFL1jvqkJAfGwsXH5DnvQo
To claim this, I am signing this object:
@eddhannay
eddhannay / gist:6799186
Created October 2, 2013 19:26
Navigator.isApplicationInstalled is supported on Android Browser, and allows a page to detect if a native app is installed
/**
* navigator.isApplicationInstalled is supported on Android 2.2.1+ in the native browser, and can be handy
* for detecting if a native app is actually running. It doesn't seem to be supported in many browsers, so
* the actual utility is pretty limited, but running this in Android Browser on a device with Spotify
* installed will open up and start playing a Moved to LA by Art Brut.
*/
if ('isApplicationInstalled' in navigator){
navigator.isApplicationInstalled('com.spotify.mobile.android.ui',
function(){
document.location = 'spotify:track:2eL6zYtrHY4xsToEkWuwTs';