Skip to content

Instantly share code, notes, and snippets.

View azza-bazoo's full-sized avatar

Hourann Bosci azza-bazoo

View GitHub Profile
@azza-bazoo
azza-bazoo / README.md
Last active September 16, 2016 18:03
CatMap: because lolcats need projection too

This is a map of the Australian state of Victoria, showing some of the locations for which cat registration data is available publicly. A bigger cat on the map means there are more real cats in that postcode; pan and zoom to explore.

You might say it's a map of cats, or a CatMap!

im in ur javascript, referencing decade-old memes

Preparing the map

Take a shapefile of "postal areas" from the Australian Bureau of Statistics. Using GDAL, find the postcodes in Victoria (starting with 3), and convert to GeoJSON. Then, run through TopoJSON for fancy lossless compression, and run our own postcode-centroids.js to generate display positions.

Keybase proof

I hereby claim:

  • I am azza-bazoo on github.
  • I am dabosq (https://keybase.io/dabosq) on keybase.
  • I have a public key whose fingerprint is C8D1 2674 077F 9331 FC19 8A45 FB6A 097D C26F 2CAD

To claim this, I am signing this object:

@azza-bazoo
azza-bazoo / index.html
Last active August 29, 2015 14:06
A rudimentary GeoJSON to SVG converter (with doohickeys to play with projections)
<html>
<head><title>Hourann's Hacked-Up GeoJSON -> SVG thingy</title></head>
<body>
<p>1. Paste GeoJSON below:
<textarea id="geojson" style="width:100%;height:150px">
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "scalerank": 1, "featurecla": "Admin-0 country", "labelrank": 3.0, "sovereignt": "Afghanistan", "sov_a3": "AFG", "adm0_dif": 0.0, "level": 2.0, "type": "Sovereign country", "admin": "Afghanistan", "adm0_a3": "AFG", "geou_dif": 0.0, "geounit": "Afghanistan", "gu_a3": "AFG", "su_dif": 0.0, "subunit": "Afghanistan", "su_a3": "AFG", "brk_diff": 0.0, "name": "Afghanistan", "name_long": "Afghanistan", "brk_a3": "AFG", "brk_name": "Afghanistan", "brk_group": null, "abbrev": "Afg.", "postal": "AF", "formal_en": "Islamic State of Afghanistan", "formal_fr": null, "note_adm0": null, "note_brk": null, "name_sort": "Afghanistan", "name_alt": null, "mapcolor7": 5.0, "mapcolor8": 6.0, "mapcolor9": 8.

> summaryRprof("Rprof.out")

$by.self
            self.time self.pct total.time total.pct
"substring"    232.76    99.87     232.76     99.87
"<GC>"           0.08     0.03       0.08      0.03
"gregexpr"       0.06     0.03       0.06      0.03
"sort.list"      0.06     0.03       0.06      0.03
"readLines"      0.04     0.02       0.04      0.02
"table"          0.02     0.01       0.08      0.03
@azza-bazoo
azza-bazoo / README.md
Last active August 29, 2015 13:57
Word clouds on a Leaflet map

First presented at the SydJS January 2014 meetup.

SydJS has had Atlassian as venue sponsor for a long time, and in that time Atlassian moved offices across town. So I took words from the titles of presentations at each location and made two word clouds. Then, I added them to a Leaflet map, overlaid on each office location!

Details and some code snippets are in my talk slides.

Based heavily on Jason Davies' d3-cloud and Mike Bostock's Leaflet integration example.

The full talk, including this example, are from the repository azza-bazoo/js-devs-dont-get-lost.