I hereby claim:
- I am mazzma12 on github.
- I am mcmzl (https://keybase.io/mcmzl) on keybase.
- I have a public key ASDefTzbN9XeopYmMf1xZ9BcsPTfYSLByZdnnlMfjU98jQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env bash | |
cat_jupyter_url () { | |
file=$(ls -rt $HOME/.local/share/jupyter/runtime/*.html | tail -n 1) | |
cat $file | grep href= | cut -d'"' -f2 | |
} |
""" | |
Once often need to parse manually a CSV which contains erroneous cell, therefore I prefer not to use gpd.read_file() | |
""" | |
from pathlib import Path | |
import geopandas as gpd | |
import pandas as pd | |
import shapely |
This will only contains the pitfalls met at installation and during utilization. So far it's great.
# Dummy HTTPS server | |
# Taken from : https://gist.github.com/dragermrb/108158f5a284b5fba806 and other repos | |
import http.server | |
import cgi | |
import base64 | |
import json | |
from urllib.parse import urlparse, parse_qs | |
import ssl | |
import os | |
import socketserver |
# Hp spectre x360 trackpad are too sensitive on the sides, which is error prone due to palm touch | |
# This work on Ubuntu 16.04, 18.04, |
#!/usr/bin/env bash | |
# Find THE notebook you have lost | |
expr=$1 # The content you are looking for : "*myCode*" | |
files=${2:-*.ipynb} # File patterns | |
find . -type f -name "$files" -exec grep -E "$expr" --with-filename {} \; |
def haversine_np(lon1, lat1, lon2, lat2): | |
""" | |
Calculate the great circle distance between two points | |
on the earth (specified in decimal degrees) | |
Reference: | |
https://stackoverflow.com/a/29546836/7657658 | |
""" | |
lon1, lat1, lon2, lat2 = map(np.radians, [lon1, lat1, lon2, lat2]) |
#!/usr/bin/env bash | |
# Pyenv https://github.com/pyenv/pyenv/wiki#suggested-build-environment | |
PYENV_PACKAGE="\ | |
build-essential libssl-dev zlib1g-dev make \ | |
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ | |
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \ | |
" | |
GIS_PACKAGE="\ | |
libproj-dev proj-data proj-bin libgeos-dev \ | |
libspatialindex-dev \ |
# Find IP address from host | |
nslookup $hostanme | |
# https://superuser.com/a/1414856 | |
nslookup $hostname | grep -i address | awk -F" " '{print $2}' | awk -F# '{print $1}' | tail -n 1 | |
# DNS issues: better use dig as host will use the local cache of the machine | |
# @ specifies another resolver than the local cache DNS | |
dig google.com +short @1.1.1.1 | |
## Docker |