Skip to content

Instantly share code, notes, and snippets.


Guillaume Aubert gaubert

View GitHub Profile
gaubert /
Created Oct 9, 2019 — forked from bee-san/
An Python implementation of Timsort
# based off of this code
# Brandon Skerritt
def binary_search(the_array, item, start, end):
if start == end:
if the_array[start] > item:
return start
return start + 1
View create_users
from random import choice
import string
import subprocess
def generate_passwd(length=8, chars=string.letters+string.digits+'{}"&$@#%*.;'):
return ''.join([choice(chars) for i in range(length)])
def generate_username(prefix="jason", index=1):
""" """
return "{}{:05d}".format(prefix, index+1)
View 000-default.conf
LoadModule mapcache_module /usr/lib/apache2/modules/
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
gaubert /
Created Feb 9, 2016 — forked from serdaradali/
Interactive world globe

Zoomable/rotatable world globe that uses orthographic projection. Drag behavior is enhanced as described here:

Performance is not good due to redrawing whole world upon zoom/drag.

View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<svg id="defs">
<linearGradient id="gradBlue" x1="0%" y1="0%" x2="100%" y2="0%">
gaubert / SingleTile.js
Created Nov 20, 2015 — forked from Zverik/SingleTile.js
A layer for single-tile WMS layers. Displays a layer as a big picture, updates it on pan and zoom. This is a hack, made for an internal project; still waiting for to be solved nicely. Example: L.singleTile('').setParams({layers: 'landsat'}).addTo(map); (won't work, because tha…
View SingleTile.js
* L.SingleTile uses L.ImageOverlay to display a single-tile WMS layer.
* url parameter must accept WMS-style width, height and bbox.
L.SingleTile = L.ImageOverlay.extend({
defaultWmsParams: {
service: 'WMS',
request: 'GetMap',
version: '1.1.1',
gaubert / gist:7f4f3e05845eface3861
Last active Aug 29, 2015
View gist:7f4f3e05845eface3861
<!- WMO_CategoryCode :: New CodeList for WMO Core Metadata Profile
<gmx:CodeListDictionary gml:id="WMO_CategoryCode">
<gml:description>additional topic categories for WMO community</gml:description>
<gml:identifier codeSpace="WMO Core Metadata Profile">WMO_CategoryCode</gml:identifier>
<gmx:CodeDefinition gml:id="WMO_CategoryCode_weatherObservations">
<gml:description>weather observations</gml:description>
<gml:identifier codeSpace="WMO Core Metadata Profile">weatherObservations</gml:identifier>
gaubert / gist:e26eb189f7e42317fbb1
Created Oct 30, 2014
typical Json document created from the ISO19115 XML Metadata record
View gist:e26eb189f7e42317fbb1
"abstract": "A DevCoCast product, GOES\/MSG Composite is a product created by composing the GOES-12 IR images with MSG IR images, every 15 minutes. Every 3 hours, the composite will be derived from the full disk of GOES and full disk of MSG, in the 13-North to 50-South Latitude; 85-West to 55-East Longitude region, encompassing South America and Africa.",
"title": "Composites - GOES-MSG - Africa, South America",
"thumbnail": "http:\/\/\/smartEditor\/preview\/GMC.jpg",
"Atmospheric conditions",
View gist:f1584808b0f1d0b845ce
import re
class CardOutParser(object):
LINEEXPR = "##T-step: old_ts#(?P<tstep_old>.*), new_ts#(?P<tstep_new>.*), gyro_Dt#(?P<dt>.*)"
lre_timing = re.compile(LINEEXPR)
LINEEXPR = "#T-acc#(?P<timestamp_tacc>.*)#Am-Raw#(?P<r_ax>.*),(?P<r_ay>.*),(?P<r_az>.*)#T-gyr#(?P<timestamp_tgyr>.*)#Gm-Raw#(?P<g_ax>.*),(?P<g_ay>.*),(?P<g_az>.*)#T-mag#(?P<timestamp_tmag>.*)#Mm-Raw#(?P<m_ax>.*),(?P<m_ay>.*),(?P<m_az>.*)"
lre_data = re.compile(LINEEXPR)
gaubert / gist:0bf785679a89a419fa30
Last active Aug 29, 2015
working elastic search query with highlight and facets
View gist:0bf785679a89a419fa30
# working query with highlight and facets first
curl -XGET 'http://localhost:9200/_search?pretty=true' -d '
{ "from" : 0, "size" : 1,
"highlight" : {
"fields" :
{ "identificationInfo.title": {"fragment_size":150,"number_of_fragments":3}, "identificationInfo.abstract": {} }
} ,
"facets" :