Skip to content

Instantly share code, notes, and snippets.

View tormi's full-sized avatar
🇪🇪
Working from home

Tormi Tabor tormi

🇪🇪
Working from home
View GitHub Profile
@tormi
tormi / proxy.php
Created December 4, 2016 18:49 — forked from bmcbride/proxy.php
Simple PHP proxy
<?php
$ch = curl_init($_GET['url']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
?>
@tormi
tormi / leaflet-custom-map.html
Created December 3, 2016 16:23 — forked from MarZab/leaflet-custom-map.html
Leaflet with latlng scale in meters and Control.Scale to match
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Custom Simple Map Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
<link rel="stylesheet" href="https://cdn.rawgit.com/ardhi/Leaflet.MousePosition/master/src/L.Control.MousePosition.css">

Keybase proof

I hereby claim:

  • I am tormi on github.
  • I am tormi (https://keybase.io/tormi) on keybase.
  • I have a public key whose fingerprint is 758F C24D 4943 1FCE 63D7 8626 E579 F66D AB78 10DB

To claim this, I am signing this object:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tormi
tormi / geojson-conversion.sh
Created October 27, 2016 15:32 — forked from benbalter/geojson-conversion.sh
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
@tormi
tormi / csv-to-geojson.sh
Created October 27, 2016 15:32 — forked from benbalter/csv-to-geojson.sh
Convert CSVs to GeoJSON, in bulk
#!/bin/bash
# Convert CSVs to GeoJSON, in bulk
# Usage: ./csv-to-geojson.sh [URL to list of CSV files]
# Outputs geoJSON files to the `output` folder
# Install csv2geojson if it's not installed
type csv2geojson || npm install -g csv2geojson
# Cleanup
rm -Rf ./tmp
@tormi
tormi / leaflet-snippet.js
Created September 20, 2016 08:37 — forked from acdha/leaflet-snippet.js
Quick and dirty script to convert Natural Earth II GeoTIFF from http://www.naturalearthdata.com/ into map tiles for display with LeafletJS
L.tileLayer('natural-earth-ii/{z}/{x}/{y}.png', {
maxZoom: 9,
tms: true
}).addTo(map);
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<Style id="huvi_style">
<IconStyle>
<Icon>
<href>
https://maps.google.com/mapfiles/ms/micons/red-dot.png
</href>
</Icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
/**
* @file
* Default theme implementation to display the basic html structure of a single
* Drupal page.
*
* Variables:
* - $css: An array of CSS files for the current page.
* - $language: (object) The language the site is being displayed in.