Skip to content

Instantly share code, notes, and snippets.

View stefanv's full-sized avatar

Stefan van der Walt stefanv

View GitHub Profile
#!/bin/bash
# From https://koenig-haunstetten.de/2017/01/02/google-calendar-integration-in-orgmode/
#
# Install into crontab with `crontab -e`:
#
# 3 * * * * ~/scripts/gcal-sync-org > /dev/null 2>&1
#
# Modify your emacs init script to load `diary.google` from DIARY_PATH:
#
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import urllib.request
import os
archive = 'https://mail.python.org/pipermail/numpy-discussion'
months = ('January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December')
output = 'mirror'
if not os.path.isdir(output):
#!/bin/bash
CONTAINERS=$(docker ps -aq)
IMAGES=$(docker images --filter dangling=true --quiet)
if [[ $CONTAINERS ]]; then
docker rm $CONTAINERS
else
echo "No containers to remove"
fi
if [[ $IMAGES ]]; then
In [3]: deprecated?
Init signature: deprecated(alt_func=None, behavior='warn', removed_version=None)
Docstring:
Decorator to mark deprecated functions with warning.
Adapted from <http://wiki.python.org/moin/PythonDecoratorLibrary>.
Parameters
----------
alt_func : str
cimport numpy as cnp
import numpy as np
ctypedef int (*kernel)(double[:] arr)
cdef kernel0(double[:] arr):
cdef int i
for i in range(arr.shape[0]):
arr[i] = 0
import subprocess
import numpy as np
res = subprocess.check_output(['git', 'shortlog', '-s', '-n', '--merges',
'--first-parent', 'master',
'--since="1 year ago"'])
res = res.decode('utf-8').split('\n')
res = [r for r in res if r.strip()]
merges, authors = zip(*[r.split(maxsplit=1) for r in res])
@stefanv
stefanv / _coords.npy
Last active May 22, 2018 00:37
Capture points and replot with cubic interpolation

Edit your milestone and in the description put on a line by itself:

on-merge: backport to v0.14.x for example.

Now if a PR is assigned a milestone before being merged, the bot will submit a backport automatically if possible. You can also manually request a backport:

@MeeseeksDev backport [to] {branch}

@stefanv
stefanv / bee_wing.txt
Created April 17, 2018 07:26
Bee Wing ID Project Description
[In collaboration with Lauren Ponisio.]
We are in the midst of Earth's sixth mass extinction due to
anthropogenic impacts such as climate change and habitat
destruction. Biodiversity provides essential services to people, such as
crop pollination and water filtration, which will also be lost as
species go extinct. Conservation biologists and ecologists have the
immense task of describing the processes that maintain biodiversity and
how we can harness those processes to restore species and the services
they provide.