Skip to content

Instantly share code, notes, and snippets.

@wx13
wx13 / .bashrc
Created January 11, 2013 19:03
Current directory in window title; sup'd up 'cd' command.
# Put the CWD in the window title.
function chtt {
echo -en "\033]2;$@\007"
}
export PROMPT_COMMAND='chtt $(pwd)'
# Put the CWD in the window title.
function chtt {
echo -en "\033]2;$@\007"
}
export PROMPT_COMMAND='chtt $(pwd)'
@wx13
wx13 / gist:959399
Created May 6, 2011 17:36
expand paths in history when using cd
function cd_save_hist() {
if [ -z "$1" ]
then
d="$HOME"
else
d="$1"
fi
builtin cd "$d"
dp=$(pwd)
history -s cd ${dp}
@mro
mro / fft.rb
Created April 4, 2011 23:46
Discrete Fast Fourier Transform from 'Meyberg, Vachenauer: Hoehere Mathematik II, Springer Berlin, 1991, page 332'
#!/usr/bin/env ruby
require 'complex'
class Array
# DFT and inverse.
#
# Algorithm from
# 'Meyberg, Vachenauer: Hoehere Mathematik II, Springer Berlin, 1991, page 332'
#
# See http://blog.mro.name/2011/04/simple-ruby-fast-fourier-transform/