Skip to content

Instantly share code, notes, and snippets.

View ThomasG77's full-sized avatar

Thomas Gratier ThomasG77

View GitHub Profile
@ThomasG77
ThomasG77 / gdal_transform_extent_to_epsg3857.py
Last active February 23, 2016 22:40
Translate extent to use with gdal_translate
# coding: utf-8
import subprocess
import sys
import getopt
import math
# Formulas from http://wiki.openstreetmap.org/wiki/Mercator#Python_Implementation
def merc_x(lon):
r_major = 6378137.000
@ThomasG77
ThomasG77 / request_to_adresse_data_gouv_fr_api.py
Created March 17, 2016 15:22
Python sample to call to adresse.data.gouv.fr
# coding: utf-8
"""Call to adresse.data.gouv.fr API."""
import codecs
import io
from collections import OrderedDict
import requests
requests_session = requests.Session()
@ThomasG77
ThomasG77 / index.html
Last active March 24, 2016 01:44
Réponse par l'absurbe à la notion de "plaque tournante" sur https://twitter.com/chdelporte/status/712756689364258816 suite aux attentats à Bruxelles
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<link rel="stylesheet" href="http://openlayers.org/en/master/css/ol.css" type="text/css">
<style>
#map {
background-color: #445c66;
height:600px;
}
# coding: utf-8
from PyQt4.QtGui import QMessageBox
from qgis.core import QgsRectangle
from qgis.gui import QgsMapToolEmitPoint
from qgis.utils import iface
canvas = iface.mapCanvas()
main_window = iface.mainWindow()
clickTool = QgsMapToolEmitPoint(canvas)
@ThomasG77
ThomasG77 / readme.md
Created September 15, 2016 23:37
"FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory" running npm search

Syndrom: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

When?

Doing an npm search whatever, npm tries to make indexing works.

It returns the "syndrom" message and as I'm using NVM a path like below referencing how npm has been called.

...
@ThomasG77
ThomasG77 / five-minutes-pgadmin4-desktop-install-guide.md
Last active May 21, 2023 09:51
5 minutes PgAdmin4 Desktop install guide

5 minutes PgAdmin4 Desktop install guide

Done on Linux (Ubuntu tested)

Virtualenv & install of Python package & its deps

cd $HOME
virtualenv --python=/usr/bin/python2.7 pgadmin4
source pgadmin4/bin/activate
@ThomasG77
ThomasG77 / LICENSE
Last active November 4, 2016 17:23
Tangram plaything with OSM2VectorTiles tiles
MIT License
Copyright (c) 2016 Thomas Gratier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ThomasG77
ThomasG77 / index.md
Created November 8, 2016 17:43
Minard online demos inventory
@ThomasG77
ThomasG77 / Readme.md
Last active January 6, 2017 00:13 — forked from timelyportfolio/Readme.md
vega for time series chart with shaded blocks

vega stocks spec forked to add shaded blocks

Often time series charts can be enhanced by shaded blocks to highlight events or periods as shown by this example which uses the R package xtsExtra. Vega specs already allow this functionality, and it is fairly easy to implement.

I added an events object to the JSON data array.

    {
      "name": "events",
      "values": [
        {"name":"Test1", "start":"Apr 2000", "end":"Mar 2003"},
@ThomasG77
ThomasG77 / README.md
Last active February 19, 2017 13:30
Correction for cluster example in my "Beginner's Guide OpenLayers 3" due to change in OpenLayers library itself