This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; I use Emacs on three different platforms and I want to use the same init file. | |
; So, this file lives as $HOME/.emacs and is just a pointer to an init file in my Dropbox. | |
; The machine specific automatic customizations are saved here nonetheless. | |
; The real dot-emacs file is in ~/Dropbox/myemacs/init.el | |
(setq my-emacs-root (expand-file-name "~/Dropbox/myemacs/")) | |
(add-to-list 'load-path my-emacs-root) | |
(load-file (concat my-emacs-root "init.el")) | |
; automatic customization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; call howdoi, https://github.com/gleitz/howdoi | |
(defvar howdoi-history nil "History for howdoi lookups, see `howdoi'") | |
(defun howdoi () | |
"Interactive function for howdoi queries. It takes the current | |
word and invokes a minibuffer where the user can accept or change | |
the query." | |
(interactive) | |
(shell-command | |
(concat "howdoi " | |
(read-from-minibuffer "howdoi: " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python2.7 | |
import gspread | |
import json | |
import httplib | |
import urllib2 | |
import urllib | |
import re | |
import os | |
import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import logging | |
logging.basicConfig() | |
logger = logging.getLogger() | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-v", "--verbose", const = 1, default = 0,type = int, nargs="?", | |
help="increase verbosity: 0 = only warnings, 1 = info, 2 = debug. No number means info. Default is no verbosity.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple example for a set of workers in Python using a function with multiple | |
# arguments (even named arguments) | |
# Sources of information: | |
# - https://docs.python.org/2/library/multiprocessing.html | |
# - http://stackoverflow.com/questions/5442910/python-multiprocessing-pool-map-for-multiple-arguments/5443941#5443941 | |
from multiprocessing import Pool, freeze_support | |
import itertools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple example on how to decode a base64 encoded data string and save it as an image file. | |
# Stephan Heuel, Ernst Basler + Partner | |
import re | |
# our base64-encoded image | |
s = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAADLElEQVR4nO2Zv2vbQBTHX0qK6WBMHKw6EOIhdvEi8I8EPByleKr3GLoFCqFbxsyeOnTsZjx5K/gPcKFUZLghkEQpeHGxPVgEGmywWzwU45Z0qE+V5ZMl3Q81gz+gwdJZel+99+7eO23c338Fv4TVBl51fdIqI57xLDzivQENN8N5x9PYYPEIebiSS5q/B3p3acykVUZejPyvHrE/3CqKNm7SKiMllwTrIRKhoeUmhjZelKBNIXexISJU/MLlkVk+DrN8HHr1LOrVs2igd11FzPLxpXP7xzfcyc4sZO/9N/PhxBCvIsgLEAmTEPtMlHi16+l/xumOtJBjyhEllwS4vgMSSsXmEBebQ6yVYlRDi80hNXRm+Tg8vr5jMWEJ30JIGFnzQSvFUEU3cEU3cCW3hwAAKrphMf6JEGNX4WtBJCHllAsV3cAvd6cAAPDxNvTv/FwcwGJu2b3Rq2eZQ8+3ELeEvhh0MABAQUk5jiNiRArxFVqi1gdaXvwtcbLM9xReNBaUFHoW+Q2jaZt7bfCDlOqXQMLMDVJw8lTBzNWvB4hR1HDcP77BThUzy8OkemQO9S3TRPAgUwgih9eQ4ZlMmIV4MW6e8J4aK94ZkbtDdJr7w2oD969UyFQj8OXND/N84qAlpcxn9ghpiGieGU3buH+lQuKgBeMahmgobRq+dYIWVndRMAshntg6WXy5YbWBM9UIRENpZA2ZI20bjrRtswIWseFghbuxAlhujMa1ZRsvz87h8uzc8TovXEKM0x2UTG0u9CN2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lizenz für die kostenlosen Geodaten des Bundesamtes für Landestopografie swisstopo | |
1. Grundsatz | |
Der vorliegende öffentlich-rechtliche Vertrag im Sinne von Artikel 12 Absatz 1 Buchstabe b des Bundesgesetzes über Geoinformation vom 5. Oktober 2007 (GeoIG) regelt an Stelle einer Verfügung den Zugang zu und die Nutzung von Geobasisdaten des Bundesrechts. | |
Durch den Vertragsabschluss anerkennt der Lizenznehmer sämtliche Vertragsbestimmungen – insbesondere den Umfang der Lizenz und die vertraglichen Verpflichtungen – sowie das Geoinformationsrecht der Schweiz. | |
Der Lizenznehmer anerkennt mit dem Vertragsabschluss weiter das ausschliessliche Recht des Lizenzgebers, über den Zugang zu und die Nutzung der Geobasisdaten des Bundesrechts zu bestimmen. Er nimmt zur Kenntnis, das Geobasisdaten urheberrechtlich geschützt sein können und anerkennt das ausschliessliche urheberrechtliche Verwertungsrecht des Lizenzgebers an den Daten. | |
2. Lizenztyp | |
Mit dem vorliegenden Vertrag wird die folgende Lizenz eingeräumt: | |
Lizenz für ko |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# short script to check compliance with eCH-0056 | |
# http://www.ech.ch/vechweb/page?p=dossier&documentNumber=eCH-0056&documentVersion=1.00 | |
# module ows_checker: https://github.com/gjn/mf-chsdi/tree/master/ows_checker | |
import ows_checker | |
esri_services = { | |
"CSW" : "http://gptogc.esri.com/geoportal/csw", | |
"WMS" : "http://example.com/arcgis/services/Beispiel/Infrastruktur/MapServer/WMSServer", | |
"WFS" : "http://example.com/arcgis/services/Beispiel/Infrastruktur/MapServer/WFSServer", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import urllib2 | |
import json | |
# GET | |
params = urllib.urlencode({'hi':'andre', 'foo': 'bar'}) | |
response = urllib2.urlopen('http://httpbin.org/get?' + params) | |
result = json.loads(response.read()) | |
print json.dumps(result, indent=2) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.