Skip to content

Instantly share code, notes, and snippets.

View nilsnolde's full-sized avatar

Nils nilsnolde

View GitHub Profile
@nilsnolde
nilsnolde / valhalla_traffic_tile_encoder.py
Last active May 20, 2022 09:12
How to encode traffic stuff for valhalla
from ctypes import *
import struct
from enum import Enum
"""
Converts valhalla's tile header & edge speeds into byte objects to be compressed.
"""
HEADER_FORMAT = '<2Q4L' # 2 uint_64, 4 uint_32 from the traffic header
@nilsnolde
nilsnolde / update_osm_files.sh
Last active June 29, 2021 12:32
Update regional OSM files (i.e. extracts) in batch with this script. Can be put in a cron job. Requires osmupdate & osmium.
#!/usr/bin/env bash
# Author: Nils Nolde <nils@gis-ops.com>
# Updated: 15-12-2020
# License: MIT
#
# Update OSM PBF files in batch by specifying a folder and a fixed update interval. For planet updates rather check https://docs.osmcode.org/pyosmium/latest/tools_uptodate.html.
#
# Requires:
# - jq
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active June 26, 2024 06:53
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@soundstorm
soundstorm / git-badges.html
Created February 6, 2017 13:29
Pure CSS Git-Badges
<html>
<head>
<style>
div.badge {
display: inline-block;
border-radius: .75em;
font-family: 'Dejavu Sans','Arial';
}
div.badge div {
display: inline-block;
@Prototype-X
Prototype-X / Install_pgAdmin4_with_python3_on_Ubuntu 16.04.md
Last active January 30, 2022 23:24
Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

  1. Get Python Wheel pgAdmin4

     wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v2.0/pip/pgadmin4-2.0-py2.py3-none-any.whl
    
  2. Install pip3

     sudo apt install python3-pip
    
@evanwill
evanwill / dualpythonnotebook.md
Created June 3, 2016 19:16
add more kernels to python 3 jupyter notebooks with anaconda

this assumes you have installed Python 3 via Anaconda distribution.

Make Python 2 kernel available to Jupyter Notebook

  1. open a terminal and create a new python 2 environment: conda create -n py27 python=2.7
  2. activate the environment: linux source activate py27 or windows activate py27
  3. install the kernel in the env: conda install notebook ipykernel
  4. install the kernel for outside the env: ipython kernel install --user
  5. close the env: source deactivate