Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
<?php
/*
Copyright (c) 2003, 2009 Danilo Segan <danilo@kvota.net>.
Copyright (c) 2005 Nico Kaiser <nico@siriux.net>
This file is part of PHP-gettext.
PHP-gettext is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@nfreear
nfreear / swiki.php
Created April 30, 2011 13:52
Display Bitbucket wiki pages with SimpleWiki parser.
<?php
/**Display Bitbucket wiki pages with SimpleWiki parser.
* A rough script for refactoring.
*
* @copyright Copyright Nick Freear, 29 April 2011.
* @uses http://simplewiki.org/language#patterns
*/
ini_set('display_errors', 1);
header('Content-Type: text/html; charset=utf-8');
@nfreear
nfreear / drupal-block_access.php
Created May 1, 2011 10:36
Drupal 6 block to launch accessibility tools: the JISC/Southampton ATbar and WebAnywhere.
<?php
/**Drupal block to launch accessibility tools: JISC/Southampton ATbar and WebAnywhere.
* Drupal 6 input format: PHP code.
*
* @copyright (c) 2010 Nicholas Freear {@link http://freear.org.uk}
* @license http://opensource.org/licenses/bsd-license.php BSD License.
* @uses http://access.ecs.soton.ac.uk/ToolBar/
* @uses http://wa.cs.washington.edu/
*/
?>
@nfreear
nfreear / cloudworks-stream-widget.html
Created May 1, 2011 10:47
CloudEngine/ Cloudworks widget to display a user's Cloudstream on your blog.
<!--
CloudEngine URL: http://cloudworks.ac.uk
Cloudworks user ID: 3
-->
<script
type="text/javascript" src=
"http://cloudworks.ac.uk/api/users/3/stream.js?count=3&amp;title=Gr%C3%A1inne%27s+Cloudstream&amp;api_key=12345"
></script>
@nfreear
nfreear / cloudengine-api-demo.php
Created May 2, 2011 09:10
Demonstration of the CloudEngine/ Cloudworks API
<?php
/** A simple demonstration of the CloudEngine/ Cloudworks API, using cURL.
*
* @copyright 2010 The Open University.
* @license http://opensource.org/licenses/bsd-license.php BSD License.
* @uses http://getcloudengine.org//wiki/API
*/
# Uncomment the following line to set a proxy for cURL.
//putenv("http_proxy=MY_HOST:PORT");
@nfreear
nfreear / drupal-block_search-plugin-buttons.jquery.js
Created May 6, 2011 21:11
Browser search plugins buttons - jQuery
<!--
Browser search plugin buttons, in a Drupal block.
Drupal 6 input format: PHP code.
@copyright (c) 2011-5-6 Nick Freear {@link http://freear.org.uk}
@license http://opensource.org/licenses/bsd-license.php BSD License.
@uses http://mycroft.mozdev.org/developer/hosting.html
@uses http://drupal.org/project/opensearch
-->
<style>a[role=button]{display:inline-block; -moz-appearance:button; -webkit-appearance:button;/*neat!*/} #search-btn{margin:8px 0;}</style>
@nfreear
nfreear / getsound.pl
Created May 7, 2011 06:17
getsound.pl: CGI script to bridge eSpeak TTS to the Web - WebAnywhere
#!/usr/bin/perl
#
# CGI script to bridge eSpeak TTS to the Web - WebAnywhere.
#
# @copyright (c)2008 University of Washington.
# @license http://www.opensource.org/licenses/bsd-license.php
# @source http://code.google.com/p/webanywhere/#trunk/tts/espeak/getsound.pl#r264
# Modifications, Nick Freear {http://freear.org.uk}
#
use strict;
@nfreear
nfreear / malt_wiki_plugin.user.js
Created May 12, 2011 09:35
User-script: Multimedia accessibility evaluation on YouTube/ 2009
// ==UserScript==
// @name MALT Wiki plugin
// @namespace http://maltwiki.org
// @author N.D.Freear[AT]open.ac.uk
// @copyright 2009-10-12 N.D.Freear, The Open University.
// @version 0.1
// @description Multimedia accessibility evaluation on YouTube, http://maltwiki.org
// Requires Firefox 3.x and Greasemonkey http://greasespot.net/
// @include http://*.youtube.com/watch?*
// ==/UserScript==
@nfreear
nfreear / stylish-rdf-twitter-yellow-black.user.css
Created May 12, 2011 09:46
User-style: Accessibility for Twitter, yellow-black / 2008
/*<RDF:Description RDF:about="rdf:#$LTa1y3"
xmlns:stylish="urn:stylish#"
xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
stylish:global="false"
stylish:namespace="http://www.w3.org/1999/xhtml"
stylish:domain="twitter.com"
stylish:description="Twitter yellow-black"
stylish:neverUpdate="false"
stylish:customized="true"
@nfreear
nfreear / drupal-block-rotator.php
Created August 1, 2011 09:52
Drupal custom rotator - block
<?php
/**Drupal rotator block - with RDFa.
©N.D.Freear, 20 Oct 2010.
*/
$links = array(
array(
'text' => '<em property="dc:title">CloudEngine</em>: powering Cloudworks<i>, on Bitbucket.</i>',
'url'=>'http://getcloudengine.org',
'img'=>'https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2010/Oct/11/cloudengine-avatar2_avatar.png'),