Skip to content

Instantly share code, notes, and snippets.

View demux's full-sized avatar

Arnar Yngvason demux

  • Reykjavík, Iceland
View GitHub Profile
@demux
demux / exchange-rates.php
Created June 24, 2013 14:12
Convert XML exchange rates from arionbanki.is to JSON or JSONP for money.js (http://josscrowcroft.github.io/money.js/)
<?php
$xml_url = 'http://www.arionbanki.is/markadir/gjaldmidlar/gengi/xml-export';
$data = simplexml_load_file($xml_url);
$out = array(
'timestamp' => time(),
'base' => 'ISK',
'rates' => array()
);
@acdha
acdha / map.html
Created April 16, 2013 16:48
Experiment using CSS display:table and viewport units to produce a vertically and horizontally centered image which is resized to fit within the window map.html contains a wide image; page.html contains a tall one Known browser bugs: WebKit treats CSS viewport units as static values rather than correctly updating them when the window is resized
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<title>
History of the Expedition Under the Command of Captains Lewis and Clark: To the Sources of the Missouri, thence Across the Rocky Mountains and down the River Columbia to the Pacific Ocean - World Digital Library
</title>
#!/usr/bin/env js
function isnet93_to_wgs84(xx, yy) {
this.x = xx;
this.y = yy;
this.a = 6378137.0;
this.f = 1/298.257222101;
this.lat1 = 64.25;