Skip to content

Instantly share code, notes, and snippets.

View nevali's full-sized avatar
🏳️‍🌈
Always, always busy

Mo McRoberts nevali

🏳️‍🌈
Always, always busy
View GitHub Profile
@nevali
nevali / jquery.dc-html.js
Created March 16, 2010 16:04
This is an extension to rdfQuery to glean DC-HTML metadata from a document. It's quick, it's dirty, it probably doesn't work properly.
(function ($) {
var ns = {}, parsedNS = false;
parseNS = function() {
parsedNS = true;
var l =$('link[rel^=schema\.]');
if(l && l[0])
{
l.each(function() {
var uri;
@nevali
nevali / gist:352971
Created April 2, 2010 09:30
Without a shadow of the doubt, one of the worst poems in the world
“Help! Help!”, I cry.
“If Excel won’t work, I might die”
So I pick up the phone and call I—
—T.
“Have you tried turning it off and on again?”, they enquire.
And, no, I have not — so do as they desire.
As if by magic, some miraculous feat,
the genius in IT fixed my spreadsheet.
$foo = array(
'foo' => 'bar',
'foo' => 'baz',
'zap' => 'bing',
);
@nevali
nevali / gist:410924
Created May 23, 2010 13:15
Rough off-the-top of my head WebIDL for a window.tv object
module tv {
// Implemented by the window object of conforming implementations.
interface TVWindow {
readonly attribute TV tv;
};
interface TV {
readonly attribute TunerCollection tuner;
readonly attribute Guide guide;
};
<?php
define('DB_USER', 'tv');
define('DB_PASS', null);
define('DB_HOST', null);
define('DB_NAME', 'mythtv');
error_reporting(E_ALL);
ini_set('display_errors', 'On');
<?php
/* This is rather naïve - suck it up. It'll probably break XMLRPC. That's left as an
* exercise to the reader. You should probably also make sure fuel_home_url() return the
* actual root, rather than assuming it's '/'. Also, this will all fail horribly with URLs
* to _other_ servers which get unexpectedly passed through the filters. A smarter
* implementation would strip off the real siteurl where it occurs at the start of the URL,
* rather than blindly stripping the host.
*/
{"episodeNumber":"1",
"seriesNumber":"1",
"curie":"spacetelescope.org:heic0705a",
"title":"Hubblecast 01",
"description":"The NASA\/ESA Hubble Space Telescope, in collaboration with several other ground- and space-based telescopes, has captured a galaxy being ripped apart by a galaxy cluster's gravitational field and harsh environment.\n\nThe finding sheds light on the mysterious process by which gas-rich spiral-shaped galaxies might evolve into gas-poor irregular- or elliptical-shaped galaxies over billions of years.",
"publisher":{"key":"spacetelescope.org","name":"ESA\/Hubble","country":"ALL"},
"uri":"http:\/\/www.spacetelescope.org\/videos\/heic0705a\/",
"shortDescription":"Hubble sees 'Comet Galaxy' being ripped apart by galaxy cluster",
"mediumDescription":"The NASA\/ESA Hubble Space Telescope, in collaboration with several other ground- and space-based telescopes, has captured a galaxy being ripped apart by a galaxy cluster's gravitational field and harsh environment.",
"kind":"episode",
<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:po="http://purl.org/ontology/po/" xmlns:mo="http://purl.org/ontology/mo/" xmlns:skos="http://www.w3.org/2008/05/skos#" xmlns:time="http://www.w3.org/2006/time#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:wgs84_pos="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:timeline="http://purl.org/NET/c4dm/timeline.owl#" xmlns:event="http://purl.org/NET/c4dm/event.owl#">
<rdf:Description rdf:about="/13ff142e-fad3-4b3f-aca5-ce7f0b20ebaa.rdf">
<rdfs:label>Description of the episode Hubblecast 01</rdfs:label>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2010-09-05T12:22:08Z</dcterms:created>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2010-09-11T19:34:59Z</dcterms:modified>
#! /bin/sh
emacsdir=/Local/Applications/Emacs.app
PATH=${emacsdir}/Contents/MacOS/bin:$PATH
export PATH
sock="$TMPDIR/emacs$UID/server"
if test x"$TERM_PROGRAM" = x"Apple_Terminal" ; then
// ==UserScript==
// @name iPlayer
// @namespace http://www.bbc.co.uk/iplayer/*
// @include http://www.bbc.co.uk/iplayer/*
// ==/UserScript==
var i = window.setInterval(function () {
if ((e = document.getElementById('bbc_emp_embed_emp'))) {
clearInterval(i);
window.addEventListener('resize', function() { doResizePlayer(e); });
doResizePlayer(e);