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
ThomasG77 / README.md
Created Nov 8, 2019
#30DayMapChallenge template
View README.md
@ThomasG77
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
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.
"Color","LineDirection","LineId","Shape"
@ThomasG77
ThomasG77 / .gitignore
Created Oct 24, 2019
Import pour scrapper parcs et jardins de Nantes
View .gitignore
node_modules/
package-lock.json
@ThomasG77
ThomasG77 / index.md
Created Sep 26, 2019
Docker/Docker-compose recipes
View index.md

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[]'` \
View pyqgis-python3-get-coordinates.py
# Execute in the PyQGIS console
def showXY(p):
print(p.x(), p.y())
currentCanvas = iface.mapCanvas()
currentCanvas.xyCoordinates.connect(showXY)
# Below enable to "unregister" listening to click event
# currentCanvas.xyCoordinates.disconnect(showXY)
@ThomasG77
ThomasG77 / .gitignore
Last active May 4, 2019
Use GDAL2Tiles to view images in Leaflet
View .gitignore
btv1b53095142n_f1.jpg
tiled/
@ThomasG77
ThomasG77 / index.html
Created May 4, 2019
Leaflet.Spin standalone (similar to official https://github.com/makinacorpus/Leaflet.Spin but use only CDNs)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Leaflet.Spin</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.4.0/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.2/spin.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.Spin/1.1.0/leaflet.spin.min.js" charset="utf-8"></script>
<style type='text/css'>
@ThomasG77
ThomasG77 / geojson_to_h3_hexagons.py
Created Apr 28, 2019
Take a GeoJSON as an input, take all H3 hexagons within and output GeoJSON hexagons with their id
View geojson_to_h3_hexagons.py
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
ThomasG77 / .gitignore
Last active Apr 28, 2019
Generate H3 hexagons
View .gitignore
node_modules/
package-lock.json
*.geojson
*.gpkg
You can’t perform that action at this time.