Skip to content

Instantly share code, notes, and snippets.

Thomas Gratier ThomasG77

Block or report user

Report or block ThomasG77

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ThomasG77 /
Created Nov 8, 2019
#30DayMapChallenge template
ThomasG77 / grease-monkey-google-url-back.js
Last active Nov 2, 2019
Greasemonkey script to restore URL view in Google search
View grease-monkey-google-url-back.js
// ==UserScript==
// @name Change URL back
// @version 1
// @include /(http|https):\/\/www\.google\.(ca|co\.in|co\.uk|com|com\.br|de|es|fr|it|pl|ru)\/search\?/
// @grant none
// ==/UserScript==
Array.from(document.querySelectorAll('cite')).forEach(el => el.textContent = el.parentElement.parentElement.href);
ThomasG77 / all_lines.csv
Created Oct 24, 2019
Demo récupération cityway API
View all_lines.csv
We can't make this file beautiful and searchable because it's too large.
ThomasG77 / .gitignore
Created Oct 24, 2019
Import pour scrapper parcs et jardins de Nantes
View .gitignore
ThomasG77 /
Created Sep 26, 2019
Docker/Docker-compose recipes

Docker-compose recipes

Get IP for PostgreSQL docker image

# Filter docker image running with port 5432 to get IP to use for Pgadmin connexion
# Get the key of the inspected network (one in our case) from this image using docker inspect
# Provide the key to access to the IP of the docker container with DB
# Copy/paste to use in PgAdmin (PS: we use a local docker running with postgres user but passwordless)
key=`docker inspect $(docker-compose ps |grep 5432 |cut -d ' ' -f1) |jq '.[].NetworkSettings.Networks|keys[]'` \
# Execute in the PyQGIS console
def showXY(p):
print(p.x(), p.y())
currentCanvas = iface.mapCanvas()
# Below enable to "unregister" listening to click event
# currentCanvas.xyCoordinates.disconnect(showXY)
ThomasG77 / .gitignore
Last active May 4, 2019
Use GDAL2Tiles to view images in Leaflet
View .gitignore
ThomasG77 / index.html
Created May 4, 2019
Leaflet.Spin standalone (similar to official but use only CDNs)
View index.html
<!DOCTYPE html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="" />
<script src=""></script>
<script src="" charset="utf-8"></script>
<script src="" charset="utf-8"></script>
<style type='text/css'>
ThomasG77 /
Created Apr 28, 2019
Take a GeoJSON as an input, take all H3 hexagons within and output GeoJSON hexagons with their id
from h3 import h3
geoJson = {'type': 'Polygon',
'coordinates': [[[37.813318999983238, -122.4089866999972145],
[ 37.7866302000007224, -122.3805436999997056 ],
[37.7198061999978478, -122.3544736999993603],
[ 37.7076131999975672, -122.5123436999983966 ],
[37.7835871999971715, -122.5247187000021967],
[37.8151571999998453, -122.4798767000009008]]] }
ThomasG77 / .gitignore
Last active Apr 28, 2019
Generate H3 hexagons
View .gitignore
You can’t perform that action at this time.