Skip to content

Instantly share code, notes, and snippets.

Avatar

Guillaume Aubert gaubert

View GitHub Profile
@gaubert
gaubert / timsort.py
Created Oct 9, 2019 — forked from bee-san/timsort.py
An Python implementation of Timsort
View timsort.py
# based off of this code https://gist.github.com/nandajavarma/a3a6b62f34e74ec4c31674934327bbd3
# Brandon Skerritt
# https://skerritt.tech
def binary_search(the_array, item, start, end):
if start == end:
if the_array[start] > item:
return start
else:
return start + 1
View 000-default.conf
LoadModule mapcache_module /usr/lib/apache2/modules/mod_mapcache.so
<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.
#ServerName www.example.com
@gaubert
gaubert / README.md
Created Feb 9, 2016 — forked from serdaradali/README.md
Interactive world globe
View README.md

Zoomable/rotatable world globe that uses orthographic projection. Drag behavior is enhanced as described here: https://www.jasondavies.com/maps/rotate/

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

View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
</head>
<body>
<svg id="defs">
<defs>
<linearGradient id="gradBlue" x1="0%" y1="0%" x2="100%" y2="0%">
@gaubert
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 https://github.com/Leaflet/Leaflet/issues/558 to be solved nicely. Example: L.singleTile('http://irs.gis-lab.info/').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
gaubert / gist:3165715
Created Jul 23, 2012 — forked from ahankinson/gist:985173
Install WxPython 2.9 64-bit with Homebrew Python Framework install
View gist:3165715
# These instructions work for OS X 10.6 with homebrew pre-installed.
brew install python --framework
brew install gfortran
# install other dependencies through pip:
pip install numpy
# the regular pip build for matplotlib is b0rken, and it can't find the built-in libraries for OSX
export LDFLAGS="-L/usr/X11/lib"
View git-branch-between-different-repositories.md

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync
@gaubert
gaubert / gist:2688273
Created May 13, 2012 — forked from pithyless/gist:1208841
Install Python 2.7 (homebrew + pip + virtualenv) on Mac OS X Lion
View gist:2688273

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

@gaubert
gaubert / btree.py
Created Dec 12, 2011 — forked from teepark/btree.py
a pure-python B tree and B+ tree implementation
View btree.py
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree
@gaubert
gaubert / btree.py
Created Nov 29, 2011 — forked from teepark/btree.py
a pure-python B tree and B+ tree implementation
View btree.py
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree