Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
@nfreear
nfreear / interwiki.markdown
Created November 14, 2012 16:40
Markdown interwiki test -- [Wiki:*] http://en.wikipedia.org/wiki/*

Markdown interwiki test

This is an example of a link by reference.

An example of an [interwiki link][Wiki:CURIE].

An abbreviation - CURIE.

@nfreear
nfreear / interwiki-xmlns-js.html
Created November 14, 2012 17:09
Expanding Interwiki links in HTML using Javascript
<html
xmlns:wiki="http://en.wikipedia.org/wiki/"
xmlns:isbn="http://en.wikipedia.org/w/index.php?title=Special%3ABookSources&amp;isbn=" >
<h1>*Interwiki/ CURIE - Javascript</h1>
<p>Find out more about <a href="[wiki:CURIE]">CURIEs</a>.
<p><a href="[isbn:0393315703]">ISBN test</a>.
@nfreear
nfreear / gutenberg-mirror-bookmarklet.js
Created November 15, 2012 14:57
Project Gutenberg Mirror links Javascript bookmarklet (jQuery) / stylesheet
/*!
Gutenberg Mirror links Javascript bookmarklet (jQuery).
(c) Nick Freear, 15 Nov 2012.
--
http://www.gutenberg.org/files/1257/1257-h/1257-h.html
Bulgaria >> http://www.gutenberg.myebook.bg/1/2/5/1257/1257-h/1257-h.html
UK/broken >> http://www.mirrorservice.org/sites/ftp.ibiblio.org/pub/docs/books/gutenberg/1/2/5/1257/1257-h/1257-h.html
--
@nfreear
nfreear / gutenberg-bookmarks-bookmarklet.js
Created November 15, 2012 15:50
Project Gutenberg Bookmarks Javascript bookmarklet (jQuery).
/*!
Gutenberg Bookmarks Javascript bookmarklet (jQuery).
Nick Freear, 15 Nov 2012.
--
http://www.gutenberg.org/catalog/world/mybookmarks
--
javascript:(function(){var d=document,s=d.createElement('script');s.type='text/javascript';s.src='http://dl.dropbox.com/u/3203144/gutenberg-bookmarks.js?x='+(Math.random());d.getElementsByTagName('head')[0].appendChild(s);})();
*/
@nfreear
nfreear / markids-bookmarklet.js
Created November 21, 2012 16:35
Mark IDs Javascript bookmarklet (jQuery)
/*
Mark IDs Javascript bookmarklet (jQuery).
N.D.Freear, 21 Nov 2012.
http://stackoverflow.com/questions/4246598/jquery-css-hover-using-variable
http://www.open.ac.uk/blogs/icons/?p=48
--
javascript:(function(){var d=document,s=d.createElement('script');s.type='text/javascript';s.src='//dl.dropbox.com/u/3203144/markids.js?x='+(Math.random());d.getElementsByTagName('head')[0].appendChild(s);})();
*/
@nfreear
nfreear / codeigniter-capret-rdfa.php
Created November 27, 2012 20:42
CodeIgniter 2.x - CaPReT author-license RDFa
<?php // https://gist.github.com/4066841
echo anchor(
'http://Author.example.org/',
'Author',
array(
'title' => 'title',
'xmlns:cc' =>'http://creativecommons.org/ns#',
'property' => 'cc:attributionName',
'rel' => 'cc:attributionURL',
)
@nfreear
nfreear / leafletjs-ou-map.html
Created November 29, 2012 20:59
Leaflet JS: quick start example / OU Map
<!doctype html><html lang="en"><meta charset="utf-8" />
<title>*LeafletJS - The Open University, MK7 6AA</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="//cdn.leafletjs.com/leaflet-0.4/leaflet.css" />
<!--[if lte IE 8]><link rel=stylesheet href="//cdn.leafletjs.com/leaflet-0.4/leaflet.ie.css"><![endif]-->
<style>
body { margin:0; background:#fcfcfc; }
@nfreear
nfreear / lint-all-files-recursive.php
Created December 5, 2012 16:04 — forked from k3n/lint-all-files-recursive.php
Applies PHP's lint check to all PHP files in a directory.
<?php // https://gist.github.com/1846220
define('LINT', '\xampp\php\php -l');
/**
* Recurses each directory and runs PHP's lint function against each file
* to test for parse errors.
*
* @param string $dir the directory you would like to start from
* @return array the files that did not pass the test
*/
@nfreear
nfreear / iframe-srcdoc.html
Created December 6, 2012 13:46
Iframe srcdoc test
<!doctype html><meta charset=utf-8 ><title>*Iframe `@srcdoc` test</title>
<style>iframe{ border:1px solid #aaa; }</style>
<h1>Iframe `@srcdoc` test</h1>
<iframe
width=400 height=300 data-X_frameborder=0
seamless data-X_sandbox
srcdoc=
"<!doctype html><hr />iframe - I'm in a `@srcdoc` attribute!
@nfreear
nfreear / iet-it-bugs-drupal6-css.php
Created December 10, 2012 13:50
Drupal 6 custom styles/CSS block -- IET-it-bugs
<?php
$styles = <<<EOS
<style type="text/css">
.node a[rel]:before, .comment a[rel]:before, .project-issue-status-info :before {
font-weight:bold; color:#444; border-bottom:1px solid #ccc; font-size:x-small;
}
.project-issue-status-info a:before { content:"Issue:" }
.node .content a[rel]:before, .comment a[rel]:before { content: attr(rel) ":"; }
.node a[rel], .node a, .comment a {