Skip to content

Instantly share code, notes, and snippets.

View tomedme's full-sized avatar

Tom Edme tomedme

  • France
View GitHub Profile
<?xml version="1.0" encoding="UTF-8" ?>
<Root PresetName="Ultimate Keyboard Mouse">
<KeyboardLayout>en-GB</KeyboardLayout>
<MouseXMode Value="Bindings_MouseRoll" />
<MouseXDecay Value="0" />
<MouseYMode Value="Bindings_MousePitch" />
<MouseYDecay Value="0" />
<MouseReset>
<Primary Device="{NoDevice}" Key="" />
<Secondary Device="{NoDevice}" Key="" />
<?xml version="1.0" encoding="UTF-8" ?>
<Root PresetName="Ultimate Joystick">
<KeyboardLayout>en-GB</KeyboardLayout>
<MouseXMode Value="" />
<MouseXDecay Value="0" />
<MouseYMode Value="" />
<MouseYDecay Value="0" />
<MouseReset>
<Primary Device="{NoDevice}" Key="" />
<Secondary Device="{NoDevice}" Key="" />
@tomedme
tomedme / .rtorrent.rc
Last active September 4, 2015 11:15
.rtorrent.rc
session = ~/downloads/sessions;
directory = ~/downloads/in_progress;
encryption = enable_retry;
upload_rate = 50;
download_rate = 250;
#use_udp_trackers = no;
@tomedme
tomedme / YouTube Tracking
Created March 28, 2010 10:53
YouTube Tracking
var youtube_width = 425;
var youtube_height = 345;
var youtubevideos = {};
var youtubevideologgers = {};
function onYouTubePlayerReady(playerId) {
youtubevideologgers[playerId] = function (state) {
if (0 == state) {
try {
pageTracker._trackEvent('Video', 'watched', youtubevideos[playerId].name);
grep -in '_\.oO' rejectlog.1 | wc -l
@tomedme
tomedme / wpcf7_json_encode.patch
Created May 19, 2010 19:45
Wordpress contact-form-7 jQuery 1.4.2 fix
Index: includes/functions.php
===================================================================
--- includes/functions.php (revision 243251)
+++ includes/functions.php (working copy)
@@ -125,6 +125,10 @@
}
function wpcf7_json( $items ) {
+
+ if (function_exists('json_encode'))
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-GB">
<head>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function () {
if ($('#'+ Location.map_dom_id).size() && google.maps) {
@tomedme
tomedme / whatisrobinplayingnow.com
Created November 23, 2010 10:31
What is Robin playing now?
<?php
$recent_tracks = simplexml_load_string(file_get_contents('http://ws.audioscrobbler.com/1.0/user/PRIVATE/recenttracks.rss'));
if ($current_track = $recent_tracks->channel->item[0]) {
$parts = explode('/', (string) $current_track->link);
$track_info_url = 'http://ws.audioscrobbler.com/2.0/?method=track.getinfo&api_key=PRIVATE&artist=%s&track=%s&autocorrect=1';
if ($track_info = simplexml_load_string(file_get_contents(sprintf($track_info_url, urlencode(urldecode(urldecode($parts[4]))), urlencode(urldecode($parts[6])))))) {
@tomedme
tomedme / mailq.sh
Created March 27, 2011 14:41
CloudKick plugin to monitor mail queue size
#!/bin/bash
NUM_EMAILS=`ls -1 /var/spool/exim4/input | wc -l`
if [ $NUM_EMAILS -lt 1000 ]; then
echo "status ok there are $NUM_EMAILS emails in the queue"
else
echo "status warn there are $NUM_EMAILS emails in the queue"
fi
echo "metric mailq int $NUM_EMAILS"
@tomedme
tomedme / jquery.pod1.fade.js
Created April 18, 2012 01:50
jquery.pod1.fade.js
// $Id: jquery.pod1.fade.js 1206 2011-01-14 09:00:53Z tedme $
/**
* Pod1Fade
* Tom Edme & Hannah Stothard
* Nov 2010.
*/
(function ($) {