Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/python
#
# Gaute Hope (gaute.hope@nersc.no) / 2015
#
# Uses a sinc-kernel to interpolate a discretely sampled signal by convolution.
#
import numpy as np
def conv_upsample (x, k, wn = None):
@gauteh
gauteh / combinepdf.sh
Created November 22, 2010 22:50
Use ghostscript to combine pdfs, first arg is output - rest is appended onto each other.
#! /bin/bash
# 2010-11-15
# Combines pdf's
# http://polybori.blogspot.com/2010/10/combining-pdfs.html
out=$1
shift
echo "Creating pdf: ${out} of: $@"
@gauteh
gauteh / photosliveextract.py
Created March 13, 2011 20:54
Extract full-sized photos from photos.live.com using rss feed
#! /usr/bin/python2
#
# Gaute Hope <eg@gaute.vetsj.com> 2011
#
# Extract full-size photos from photos.live.com using rss feed
#
# Requires: - feedparser: http://feedparser.org/ - Python 2
VERSION = 1
@gauteh
gauteh / .gitignore
Created November 5, 2011 23:19
python script for starring and liking google reader items from exported json (used to migrate starred and liked items), check http://gaute.vetsj.com/greader for web app version.
*.json
*.xml
token*
oauth*
#! python
# Format: (y, x, [userdata], ..)
# Sorterer i stigande rekkefølge
positions = [ (1.0 , 1.1, 1),
(10.0 , 50.0, 2),
(9.0 , 39.0, 3),
(30.0 , 5.0, 4),
(40.0 , 10.0, 5),
]
@gauteh
gauteh / sprunge
Created April 20, 2012 13:31
Wrapper for sprunge.us pastebin
#! /bin/bash
# Wrapper for curl, posting to the sprunge.us pastebin
cat $1 | curl -F 'sprunge=<-' http://sprunge.us
/* Based on: http://stackoverflow.com/questions/8571089/how-can-i-find-endian-ness-of-my-pc-programmatically-using-c
*
* Build: gcc -o whatendianness whatendianness.c
*
*/
# include <stdio.h>
int main (int argc, char **argv) {
int num = 1;
@gauteh
gauteh / m_sup
Last active December 12, 2015 03:08
lbdb module for the sup contact list
#! /bin/bash
# A module for lbdb (http://www.spinnaker.de/lbdb/) for the sup address
# book (http://sup.rubyforge.org)
# Copyright (C) 2009 Gaute Hope <eg@gaute.vetsj.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@gauteh
gauteh / authordate4-url.bst
Last active December 17, 2015 20:39
BibTex style for natbib (author year) based on authordate4.bst with support for URL and date accessed.
% Based on: authordate4.bst, plainnat.bst and opcit.bst
%
%
% This BibTeX 0.99 style file is intended for documents that use the
% author-date citation system. It should be used in conjunction with the
% authordate1-4.sty (or equivalent) LaTeX style-option.
%
% In deciding on the bibliography layout to be implemented, the following
% works have been consulted:
% 1. British Standard 5605: "Citing publications by bibliographic
#! /bin/bash
# A module for lbdb (http://www.spinnaker.de/lbdb/) for gmail
# using goobook.
# Copyright (C) 2013 Gaute Hope <eg@gaute.vetsj.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or