Skip to content

Instantly share code, notes, and snippets.

View ezietsman's full-sized avatar

Ewald Zietsman ezietsman

View GitHub Profile
@ezietsman
ezietsman / build_deeming.sh
Last active August 26, 2020 20:42
Python, Cython, Fortran f2py and OpenCL versions of a Deeming periodogram
#!/bin/bash
f2py -c -m deeming periodogram.f90 -lgomp
f2py -c -m deemingomp periodogram.f90 --f90flags="-fopenmp " -lgomp
@ezietsman
ezietsman / pynger.py
Last active August 29, 2015 14:17
Make graphs of Pings to an IP. For troubleshooting my adsl connection.
'''
Pynger:
App that pings a given IP address and saves the pings in the file.
Usage:
pynger.py [ip]
ip: the IP address to be pinged. If this is left empty it will default to
the ADSL router I hit first.
@ezietsman
ezietsman / bson-threadsafe-iterator.py
Created October 9, 2017 22:30
Threadsafe Iterator for BSON files for kaggle use.
def grouper(n, iterable):
'''
Given an iterable, it'll return size n chunks per iteration.
Handles the last chunk too.
'''
it = iter(iterable)
while True:
chunk = tuple(itertools.islice(it, n))
if not chunk:
return