Skip to content

Instantly share code, notes, and snippets.

@hevgyrt
hevgyrt / aen_webinar_netcdf_cf_acdd.ipynb
Last active August 24, 2022 12:26
Tutorial for how to create CF and ACDD compliant NetCDF files in the context of the Nansen Legacy project
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrewharvey
andrewharvey / index.md
Last active May 24, 2023 10:21
Comparison of point and box spatial index libraries for JavaScript
Library Static / Dynamic Cartesian / Geographic kNN Index containing points Index containing boxes Within radius
rbush dynamic 🗺️ cartesian ✔️ ✔️
rbush-knn dynamic 🗺️ cartesian ✔️ ✔️ ✔️ ✔️
kdbush static 🗺️ cartesian ✔️ ✔️
geokdbush static 🌏 geo ✔️ ✔️ ✔️
flatbush static 🗺️ cartesian ✔️ ✔️ ✔️ ✔️
geoflatbush static 🌏 geo ✔️ :heavy_che
@gauteh
gauteh / github-thread.py
Last active October 17, 2017 10:53
Open GitHub issue from Notmuch thread or Message ID
#! /usr/bin/env python
#
# Author: Gaute Hope <eg@gaute.vetsj.com> / 2017-10-08
import os, sys, os.path
import subprocess
import notmuch
import email
import email.parser
import email.policy
@Cyberek
Cyberek / README.txt
Last active September 9, 2021 00:17
Starting Kodi automatically on Raspbian Jessie and Stretch
So you were able to install Kodi via "sudo apt-get install kodi" but have no idea how to force it to autostart on boot?
You have tried all those googled solutions such as adding kodi-standalone to .bashrc, creating init.d script but nothing worked?
This is the right place to get the answer.
For some reason, the current version of Kodi doesnt provide 2 important files:
/etc/init.d/kodi
/etc/default/kodi
#! /usr/bin/python
#
# Author: Gaute Hope <eg@gaute.vetsj.com> / 2016-08-12
#
# Find all substrings in a string with the number of occurences of a set of
# characters pre-defined.
#
# A prime number is assigned to each character in the key set, all other
# characters are assigned 1. The product of the key set will match the product
# of the substring. Search the string with a running product to find substring
@dbuscombe-usgs
dbuscombe-usgs / hillshade.py
Created March 27, 2015 12:48
shaded relief algorithm in python
import numpy as np
def cart2pol(x, y):
'''
cartesian to polar coordinates
'''
theta = np.arctan2(y, x)
rho = np.sqrt(x**2 + y**2)
return (theta, rho)
@dgerod
dgerod / custom_run.py
Last active June 19, 2019 15:12
The %my_run command execute a script in IPython as %run does but searching the file in the user path in addition to the python path.
# =======================================================================================
# Startup file with magic functions: %my_run, %add_custom_path, %clean_custom_path and
# %show_custom_path, which runs stuff in the python path as well as user specified paths.
#
# The %my_run command executes a script as %run does but searching the script in
# the user path in addition to python path.
#
# ---------------------------------------------------------------------------------------
# This is a modification of the code done by Gaute Hope <gaute.hope@nersc.no> due to
# IPython issue 101
@gauteh
gauteh / 01-run-paths.py
Last active August 29, 2015 14:13
add %mrun and %addpath magics that searches pythonpath and allows adding custom paths to an %run like command (%mrun)
# based on ipython issue #101
#
# author: Gaute Hope <gaute.hope@nersc.no> / 2015
#
# references:
#
# https://github.com/ipython/ipython/issues/101
# http://ipython.org/ipython-doc/dev/config/custommagics.html
#