Skip to content

Instantly share code, notes, and snippets.

View Cyrille37's full-sized avatar

Cyrille Giquello Cyrille37

View GitHub Profile
@cquest
cquest / communes.csv
Created October 3, 2019 06:10
CSV des communes françaises obtenu par https://overpass-turbo.eu/s/MOT
We can't make this file beautiful and searchable because it's too large.
ref:INSEE name @lat @lon
75056 Paris 48.8588657 2.3469411
50162 Digosville 49.6318164 -1.5276368
50077 Bretteville 49.6516917 -1.5084320
50296 Maupertus-sur-Mer 49.6568139 -1.4843194
50101 Carneville 49.6577501 -1.4489368
50178 Fermanville 49.6801166 -1.4551308
50539 Saint-Pierre-Église 49.6723729 -1.4023987
50596 Théville 49.6514985 -1.4152740
66136 Perpignan 42.6990664 2.9045778
@cquest
cquest / tilecache.conf
Last active October 3, 2019 06:34
Exemple de configuration nginx pour installer un cache de tuiles OSM
# conserver les tuiles dans /var/cache, pendant 24h et au maximum 16Go
proxy_cache_path /var/cache/nginx-tilecache levels=1:2 keys_zone=tilecache:100m inactive=24h max_size=16G;
server {
server_name tilecache.mondomaine.tld a.tilecache.mondomaine.tld b.tilecache.mondomaine.tld c.tilecache.mondomaine.tld;
listen 80;
location / {
proxy_pass http://tilecache.openstreetmap.fr;
proxy_cache tilecache;
@cquest
cquest / osm-stats-54.sh
Created July 6, 2017 09:57
Extraction des contributeurs sur un département
wget http://download.geofabrik.de/europe/france/lorraine-latest.osm.pbf
wget "http://polygons.openstreetmap.fr/get_poly.py?id=51856&params=0" -O 54.poly
osmconvert lorraine-latest.osm.pbf -B=54.poly -o=54.pbf
osmconvert 54.pbf --out-osm | grep 'user=".*"' -o | sort | uniq -c | sort -n > stats.txt
@anttiviljami
anttiviljami / wp-admin-modal-dialog.php
Last active May 22, 2024 13:05
WordPress admin modal dialog example
<?php
// enqueue these scripts and styles before admin_head
wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though...
wp_enqueue_style( 'wp-jquery-ui-dialog' );
?>
<!-- The modal / dialog box, hidden somewhere near the footer -->
<div id="my-dialog" class="hidden" style="max-width:800px">
<h3>Dialog content</h3>
<p>This is some terribly exciting content inside this dialog. Don't you agree?</p>
@cquest
cquest / stats-oedb.csv
Created August 18, 2016 16:01
OpenEventDatabase content on 2016-08-18
events_what count oldest newest geometries
air.pollution.level 170 2016-06-06 00:00:00+00 2016-08-19 00:00:00+00 8
air.pollution.level.warning 32 2016-08-10 00:00:00+00 2016-08-19 00:00:00+00 8
alert 4 2016-06-07 16:00:00+00 2016-06-11 10:42:00+00 4
alert.emergency 19 2016-01-07 13:00:00+00 2017-07-31 17:00:00+00 19
alert.supervision 2 2016-07-29 09:00:00+00 2016-07-30 10:00:00+00 2
convention 3 2016-05-20 07:00:00+00 2016-09-25 16:00:00+00 3
culture.arts 48 2015-06-06 12:00:00+00 2025-12-31 16:00:00+00 25
culture.entertainment 22 2016-07-22 20:30:00+00 2016-10-16 17:00:00+00 13
culture.music 3094 2016-06-17 14:30:00+00 2016-09-22 21:00:00+00 2206
@rowanwins
rowanwins / gist:abec8d7aebeb27db49df
Created November 23, 2014 10:01
Creating a time slider with leaflet.js
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Time slider data</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
@r-sal
r-sal / PHPExcel_Basics.md
Last active May 8, 2024 06:29
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

@charliepark
charliepark / gist:4266921
Created December 12, 2012 10:58
You can use arrays and hashes in HTML5 data attributes. Use JSON.parse, and make sure you're using single quotes around the brackets and double quotes inside the brackets.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<div id="animals" data-animals='["cat", "dog", "bird"]'></div>
<div id="vehicles" data-vehicles='{"motorcycle":"Harley", "car":"Herbie", "steamshovel":"Mike"}'></div>
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {