This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX pc: <http://data.ordnancesurvey.co.uk/ontology/postcode/> | |
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> | |
SELECT ?lat ?long | |
WHERE { | |
<http://data.ordnancesurvey.co.uk/id/postcodeunit/OX30NG> | |
geo:long ?long; | |
geo:lat ?lat | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This fires an animation, but returns a | |
// deferred object rather than the jQuery object | |
$.fn.deferredAnimate = function( prop, speed, easing, callback ){ | |
var dfr = $.Deferred(); | |
// update the appropriate arguments | |
if(typeof speed === "object"){ | |
speed.complete = withResolve(speed.complete); | |
} else { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* $.convertJSONDates | |
* | |
* $.getJSON(…).pipe($.convertJSONDates).done(function(data){…}) | |
* | |
* Based on … | |
* | |
* jQuery.parseJSON() | |
* http://erraticdev.blogspot.com/2010/12/converting-dates-in-json-strings-using.html | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// There are some webkit issues: | |
// - chrome 18 - won't display svg paths with linecap="round" + dash-array="0,2" | |
// (http://code.google.com/p/chromium/issues/detail?id=21057) | |
// | |
// - safari (iOS5 only) - will badly mistranslate linecap=(not round) + dash-array=(anything) | |
// | |
// This 'fix' means that the dash array will not have any zero-width dashes so will work | |
// across those two webkit browsers. | |
if(paper.raphael.svg){ | |
// also - applying this straight off doesn't seem to work with raphael so it needs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a placeholder for us to gather the steps with when | |
// we know what we want to do with them | |
var stepHandler; | |
// the actual function that will be called by the data section | |
function step(name, fn){ | |
// if our handler has been assigned | |
if(stepHandler){ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Button = function(){ | |
this.presses = 0; | |
} | |
Button.prototype.press = function(){ | |
this.presses++; | |
} | |
describe('button', function(){ | |
// this is out of 'beforeEach', becuase we want to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
method create(colour){ | |
class customClass{} | |
customClass.colour = colour; | |
return customClass; | |
} | |
RedClass = create('red'); | |
GreenClass = create('red'); | |
redInstance = new RedClass(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include social media scripts | |
window.___gcfg = {lang: 'en-GB'}; | |
(function include(id, src){ | |
var s = 'script',js, fjs = document.getElementsByTagName(s)[0]; | |
if (!document.getElementById(id)){ | |
js = document.createElement(s); js.id = id; | |
js.src = src; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$(function(){ | |
var rnd = function(n){ | |
return Math.floor((Math.random()*n*n)) % n | |
} | |
var elements_at = function(at){ | |
return $('li:visible').filter(function(){ | |
return $(this).css('left') == (at*350) + 'px'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var props = { | |
js:true, | |
touch : 'ontouchstart' in window, | |
overflowScroll: document.documentElement && ('webkitOverflowScrolling' in document.documentElement.style), | |
iframe: window!=window.top | |
}; | |
var cns = []; | |
for(var p in props){ | |
if(props.hasOwnProperty(p)){ |