Skip to content

Instantly share code, notes, and snippets.

View aidanheerdegen's full-sized avatar

Aidan Heerdegen aidanheerdegen

  • Australian Earth-System Simulator National Research Infrastructure (ACCESS-NRI)
  • ACCESS-NRI, Australian National University
View GitHub Profile
@aidanheerdegen
aidanheerdegen / bulk_mail.py
Last active April 7, 2021 00:14 — forked from JustusAdam/bulk_mail.py
Send a bunch of formatted emails using python templates and YAML/JSON data.
#!/usr/bin/env python3
"""
If you, like me, often have to send a bunch of very similer emails to a bunch of
people you may have got tired of copy pasting and resending as well.
This is my proposed solution:
This script reads a template file, using the simple python templating language
that substitutes vaules like $this with data from a dictionary.
@aidanheerdegen
aidanheerdegen / filehash.py
Created March 19, 2019 00:07 — forked from danlmarmot/filehash.py
This Python script measures hash performance, and attempts to answer this question: 'Given a hash function and a block size for reading, which is the fastest hash function and block size?'
__author__ = 'danlmarmot'
"""
This Python script measures hash performance, and attempts to answer this question:
'Given a hash function and a block size for reading, which is the fastest hash function and block size?'
There's no warm up, there's no cache/memory/whatever filling, just a simple way to explore performance for
commonly used functions with the timeit library
"""
@aidanheerdegen
aidanheerdegen / histogram.py
Created May 21, 2018 05:05 — forked from duartecosta1/histogram.py
Plotting a histogram based on maximum temperature frequencies
import xarray
from scipy.stats import norm
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
list_indices = ['tasmax']
indices = list_indices[0]
data = xarray.open_dataset('/g/data3/w97/dc8106/AMZ_def_EXPs/test/tasmax_sc_001GPsc_E0_test.nc', chunks={'time':1000})
@aidanheerdegen
aidanheerdegen / node-parallel.sh
Created March 29, 2018 05:12 — forked from ScottWales/node-parallel.sh
Run a program in parallel across multiple nodes
#!/bin/bash
# A cross-node version of gnu parallel
#
# node-parallel [command [arguments]] < list_of_arguments
# node-parallel [command [arguments]] ( ::: arguments | :::: argfile(s) )*
#
# The command can use gnu parallel replace tags (e.g. '{}' is replaced with an
# argument), see 'man parallel' for full details.
# Note that unlike gnu parallel a '{}' will not be automatically added if not
# present, it must be manually added.
module quart
implicit none
type quaternion
! q(4) = (w, x, y, z) where w is the scalar part
real :: q(4)
! Flags to tell us if we want to keep the quaternion unitised, and
! also if the quaternion represents an improper rotation (rotation + inversion)
logical :: unit
logical :: improper