Skip to content

Instantly share code, notes, and snippets.

@johanhdm
johanhdm / index.html
Created March 23, 2012 07:19
Protovis + Google Maps API V3 - Oakland Crimespotting
<!DOCTYPE html>
<html>
<head>
<title>Oakland Crimespotting</title>
<script src="http://mbostock.github.com/protovis/protovis-r3.2.js" type="text/javascript"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="oakland.js"></script>
<style type="text/css">
html { height: 100% }
@johanhdm
johanhdm / gist:2224747
Created March 28, 2012 08:30
JSON stringify associative array returns empty array - use {} instead of new Array()
//JSON.stringify an associative array using the Array object --> does not work
var array1 = new Array();
array1['a'] = { x : 1, y : 2 };
console.log(array1);
//outputs : [ a: { x: 1, y: 2 } ]
console.log(JSON.stringify(array1));
//outputs : []
@johanhdm
johanhdm / gist:7632451
Created November 24, 2013 21:11
Posten API - adresser och postnummer
Förslag på adresser:
http://www.posten.se/_layouts/Posten/NordicWeb/pgm/Suggest.ashx?maxResults=10&country=se&search=waernsgatan&showNumbers=true&streetOnly=false
Leta upp stad på postnummer:
http://www.posten.se/_layouts/Posten/NordicWeb/pgm/PostalCodeLookup.ashx?country=se&postalcode=41670