Skip to content

Instantly share code, notes, and snippets.

@Tomfox91
Tomfox91 / minx-air-shutdown.sh
Created July 20, 2015 20:06
Command to shut down a Minx Air 200.
echo -en '\x00\x05\x01\x02\x00\x00\x00' | nc $IP 43000
@Tomfox91
Tomfox91 / mediaExtractor.js
Created February 14, 2015 15:59
Bookmarklet to extract media URLs from webpages. http://gh.t-f.pw/mediaExtractor/ (jQuery insertion code from http://benalman.com/projects/run-jquery-code-bookmarklet/)
(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="https://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.3.2",function($,L){
var ul = $('<ul></ul>');
var urls = $('video,audio')
.map(function() {
return $(this).attr('src');});
if (urls.length) {
urls.each(function() {
@Tomfox91
Tomfox91 / reminders-sort.js
Created February 8, 2015 11:28
Script to sort alphabetically the completed reminders in Apple Reminders. Written in JavaScript (works in Yosemite).
var listName = '<list name>'
var Reminders = Application('Reminders');
var list = Reminders.lists.byName(listName);
var done = [];
var reminders = list.reminders.whose({completed: true});
var rl = reminders.length;
Progress.totalUnitCount = 2 * rl;
@Tomfox91
Tomfox91 / format.sed
Created September 10, 2014 13:13
Quick-and-dirty converter from HTML table to Tab-delimited flat-file. Uses sed and bash. Converts the first table in a HTML document to a Tab-delimited file. Usage: `./tableConverter.sh < file.html`
s![ \t]*<!<!g
s!>[ \t]*!>!g
s!<tr>!\
!g
s!</t[dh]><t[dh]>! !g
s!<table>\n!!g
@Tomfox91
Tomfox91 / brConv.d
Created August 14, 2014 19:59
Converter for .BR3, .BR4, .BR5 files produced by BMW music backups. Simply negates all bites. See http://www.1erforum.de/hifi-navi/konvertieren-von-br4-br5-mp3-22678.html.
import std.file;
int main(char[][] args) {
if (args.length != 2) return 101;
auto filename = args[1];
auto basename = filename[0 .. $-4];
auto extension = filename[$-3 .. $];
if (!exists(filename)) return 102;
@Tomfox91
Tomfox91 / URM.hs
Created February 28, 2014 14:33
Haskell implementation of some functions inspired by N. J. Cutland's book, ‘Computability. An introduction to recursive function theory’, including the universal function ψ.
module Main () where
import Prelude hiding ((+), (-), (*), (/), (^), succ, div, min, max)
import qualified Prelude as P
import Debug.Trace (trace)
optimization = 42
class (Show v) => Val v where
@Tomfox91
Tomfox91 / keyboard.xml
Created December 25, 2013 20:15
XBMC keyboard.xml file for the “Shutter Remote” Bluetooth remote. Works with XBMC 12.2 on OS X Mavericks. Enables basic navigation and skipping during playback. See http://wiki.xbmc.org/index.php?title=Keymap.
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<global>
<keyboard>
<g>Right</g>
<next_track>Right</next_track>
<prev_track>Left</prev_track>
<play_pause>Select</play_pause>
</keyboard>
</global>