Skip to content

Instantly share code, notes, and snippets.

View jstadler's full-sized avatar

Jordan Stadler jstadler

  • Ontario, Canada
View GitHub Profile
@jstadler
jstadler / bhattacharyya
Created July 9, 2014 05:57
Implementation of the Bhattacharyya distance in Python
# bhattacharyya test
import numpy
import math
h1 = [ 1, 2, 3, 4, 5, 6, 7, 8 ];
h2 = [ 6, 5, 4, 3, 2, 1, 0, 0 ];
h3 = [ 8, 7, 6, 5, 4, 3, 2, 1 ];
h4 = [ 1, 2, 3, 4, 4, 3, 2, 1 ];
h5 = [ 8, 8, 8, 8, 8, 8, 8, 8 ];
@jstadler
jstadler / datetime_string.py
Created April 1, 2014 13:26
Useful for generating time dependent strings
import datetime
print datetime.datetime.now().strftime("%y-%m-%d-%H-%M-%S")
@jstadler
jstadler / ConfigParser.cs
Created March 30, 2014 08:11
Configuration file parser for configurations files that follow the format: [section]<EOL> parameter = value<EOL> ;comment<EOL>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
namespace FileReader
{
class Program
@jstadler
jstadler / unity3d-frame-save
Created March 17, 2014 06:53
Unity3D C# script to write each frame to disk.
using UnityEngine;
using System.Collections;
public class FrameDump : MonoBehaviour {
string folder = "frame dumps";
int frameCount;
// Initialization
@jstadler
jstadler / Xdefaults 2011
Created March 10, 2012 01:08
A .Xdefaults file. Notable for the color scheme which I used for over a year. Tango colors were chosen and desaturated to 65% and 45%. Very readable for the most part. Really enjoy the Inconsolata font.
URxvt*scrollBar: false
! URxvt*font: xft:Inconsolata:bold:8
URxvt*font: -*-terminus-bold-r-normal-*-13-*-*-*-*-*-*-*
! COLORS
urxvt*foreground: #b5ff59
urxvt*background: #1f1f1f
@jstadler
jstadler / vimrc_2011_sept
Created March 10, 2012 01:06
A vim configuration I used over the course of 6+ months. Worked well, felt the need to keep it somewhere.
set nocompatible
set cindent
set smartindent
set autoindent
set tabstop=4
set shiftwidth=4
set showmatch
set ruler
set incsearch
set number
@jstadler
jstadler / mpd_2011_sept
Created March 10, 2012 01:05
Minimal MPD config file used at one point, did the job.
port "6600"
music_directory "~/Music"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
audio_output {
type "alsa"
name "ALSA"
mixer_control "Master"
@jstadler
jstadler / conkyrc_2011_sept
Created March 10, 2012 01:03
A very minimal conkyrc file, should be a single bar (might have been used with DWM).
background no
out_to_console yes
out_to_x no
update_interval 1.0
total_run_times 0
use_spacer none
#${mpd_smart} ${mpd_elapsed}/${mpd_length}
TEXT
KERNEL: ${sysname} ${kernel} CPU1: ${cpu cpu1}% CPU2: ${cpu cpu2}% MEM: ${memperc}% ETH0: ${downspeedf eth0} || ${upspeedf eth0} WLAN0: ${downspeedf wlan0} || ${upspeedf wlan0} BATT: ${battery_short}
@jstadler
jstadler / bashrc_sept_2011
Created March 10, 2012 01:01
A .bashrc file used at one point, notable alias worth keeping is desup, also liked these PS1's.
# ~/.bashrc
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
alias desup='sudo mount -t cifs //192.168.xxx.xxx/x -o username=xx,password=xx /mnt/m1'
alias desdn='sudo umount /mnt/m1'
PS1='\n\[\033[0;32m\]\u@\h \[\033[1;33m\]\w\n\[\033[0m\]> '