Skip to content

Instantly share code, notes, and snippets.

@swaldman3
swaldman3 / fnCalcD3DTimesteps.m
Created September 14, 2016 09:06
Matlab function to extract timestep times from a Delft3D map file
function [ sdTimesteps ] = fnCalcD3DTimesteps( nfs )
%FNCALCD3DTIMESTEPS Work out dates of D3D timesteps
% Function to take an "nfs" object (a Delft3D data file opened with
% vs_use) and output an array of MATLAB serial dates corresponding to the
% output timesteps in the file.
% Requires Delft3D MATLAB toolbox.
% Simon Waldman / Heriot-Watt University 2016
@swaldman3
swaldman3 / install_mosh_locally.sh
Created February 21, 2016 06:00 — forked from xiaom/install_mosh_locally.sh
install mosh locally
#!/bin/sh
# this script does absolutely ZERO error checking. however, it worked
# for me on a RHEL 6.3 machine on 2012-08-08. clearly, the version numbers
# and/or URLs should be made variables. cheers, zmil...@cs.wisc.edu
mkdir mosh
cd mosh
@swaldman3
swaldman3 / dwu
Created September 8, 2013 07:26
My current dwu script
#!/bin/bash
# make sure we are in the right directory;
# save previous directory
oldpwd=$PWD
cd $LJHOME
oldbranch1=$(git symbolic-ref --short -q HEAD)
# pull changes from dreamwidth
@swaldman3
swaldman3 / commit-msg
Created October 7, 2012 15:19
Git hooks - to go in .git/hooks/
#!/bin/sh
if diff "$1" "$1.tmp" > /dev/null; then
echo >&2 Aborting commit due to unchanged commit message.
rm "$1.tmp"
exit 1
else
rm "$1.tmp"
fi