Skip to content

Instantly share code, notes, and snippets.

View tony2nite's full-sized avatar

Anthony Hughes tony2nite

  • Barcelona, Spain
View GitHub Profile
@tony2nite
tony2nite / ffmpeg-avi-mp4-convert.sh
Created July 11, 2020 12:30
convert old AVI to MP4 with good quality, keeping original date/time
for i in *.avi; do ffmpeg -i "$i" -metadata date="$(stat -f %SB -t "%Y-%M-%d %T" $i)" -vf yadif -c:v libx264 -preset slow -crf 22 "${i%.*}.mp4";touch -r "$i" "${i%.*}.mp4"; done
@tony2nite
tony2nite / bluetooth-agent.sh
Created July 17, 2017 21:05 — forked from kingster/bluetooth-agent.sh
Raspberry PI Bluetooth Audio Player
### BEGIN INIT INFO
# Provides: bluetooth-agent
# Required-Start: $remote_fs $syslog bluetooth pulseaudio
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Makes Bluetooth discoverable and connectable to 0000
# Description: Start Bluetooth-Agent at boot time.
### END INIT INFO
#! /bin/sh

Keybase proof

I hereby claim:

  • I am tony2nite on github.
  • I am ahughes (https://keybase.io/ahughes) on keybase.
  • I have a public key whose fingerprint is 7922 F032 2BBF 9E38 F9F1 B1DD B263 E51E 0717 708E

To claim this, I am signing this object:

@tony2nite
tony2nite / browserslist-cli.js
Created June 3, 2015 11:05
Simple CLI wrapper to console.log browserslist results to terminal
// run it like: node browserslist-cli.js '> 2% in GB'
var browserslist = require('browserslist');
console.log(process.argv[2]);
var b = browserslist(process.argv[2]);
console.log(b);
@tony2nite
tony2nite / gist:759c4464ed19db210ee3
Created August 10, 2014 12:40
GoT Contact Form Bookmarklet :: Overwrites a form's title dropdown with GoT character titles
var $title = $('option').filter(function () { return $(this).html().indexOf('Mr.') != -1; });
if ($title) {
window.kimonoCallback = function(data) {
// do something with the data
// please make sure the scope of this function is global
var options = jQuery.map( data.results.collection1, function( title ) {
var t = title.characterTitle.text;
@tony2nite
tony2nite / read-guardian-in-facebook
Created April 17, 2012 11:16
Bookmarklet to redirect from an article on The Guardian site to The Guardian Facebook app
<html>
<body>
<a href="javascript:(function () {
var host = 'http://www.guardian.co.uk/';
var url = location.href;
if (url.indexOf(host) == 0) {
var dir = url.substring(host.length);
var FACEBOOK_GUARDIAN = 'https://apps.facebook.com/theguardian/';
location.href = FACEBOOK_GUARDIAN + dir;
}