Skip to content

Instantly share code, notes, and snippets.

@crofty
crofty / leaflet-google.js
Created March 25, 2012 15:07
Leaflet plugin that enables the use of Google Map tiles - http://matchingnotes.com/using-google-map-tiles-with-leaflet
/*
* L.TileLayer is used for standard xyz-numbered tile layers.
*/
L.Google = L.Class.extend({
includes: L.Mixin.Events,
options: {
minZoom: 0,
maxZoom: 18,
tileSize: 256,
We couldn’t find that file to show.
@crofty
crofty / gist:faa68b817ec27b39b8989ee77ad44efd
Created September 27, 2022 10:20
bettermotherfuckingwebsite css
/* Originally from http://bettermotherfuckingwebsite.com */
@import url('https://fonts.googleapis.com/css?family=Inconsolata|Inter&display=swap');
body {
margin: 40px auto;
max-width: 900px;
line-height: 1.6;
font-size: 16px;
color: #444;
padding: 0 10px;
font-family: 'Inter', sans-serif;;
@crofty
crofty / index.html
Last active October 22, 2021 08:24
A example of using Google Map tiles with the Leaflet mapping library - http://matchingnotes.com/using-google-map-tiles-with-leaflet
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script>
</head>
<body>
@crofty
crofty / README.md
Last active November 21, 2019 02:45
Tracking Vehicles

This shows the movement of 330 vehicles travelling round the UK & Ireland over a 24hr period.

More

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>UK Map</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
svg {
width: 500px;
height: 500px;
@crofty
crofty / core.clj
Created October 2, 2018 14:22
Document serialization
(ns doc-serialization.core)
(def block-tags
{"h2" :h2
"h3" :h3
"h4" :h4
"p" :p})
(defn serialize-leaf [leaf]
[:span (:text leaf)])
@crofty
crofty / elevation.xml
Last active February 24, 2018 20:58
GDAL WMS for the Elevation dataset on AWS
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>https://s3.amazonaws.com/elevation-tiles-prod/geotiff/${z}/${x}/${y}.tif</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-20037508.34</UpperLeftX>
<UpperLeftY>20037508.34</UpperLeftY>
<LowerRightX>20037508.34</LowerRightX>
<LowerRightY>-20037508.34</LowerRightY>
<TileLevel>14</TileLevel>
@crofty
crofty / Tyrant install
Created September 4, 2009 17:52
Tokyo Cabinet / Tyrant install
# First do a check to see what versions of TC/TT are supported by the ruby gem
# http://rufus.rubyforge.org/rufus-tokyo/
# Install tokyo cabinet
wget http://sourceforge.net/projects/tokyocabinet/files/tokyocabinet/1.4.29/tokyocabinet-1.4.29.tar.gz/download
tar xvf tokyocabinet-1.4.29
cd tokyocabinet-1.4.29
./configure
make
sudo make install
// Version: v1.0.0-pre.2-396-g99357c2
// Last commit: 99357c2 (2013-01-14 11:38:40 +0000)
(function() {
/*global __fail__*/
/**
Ember Debug