Skip to content

Instantly share code, notes, and snippets.

View mattfoster's full-sized avatar

Matt Foster mattfoster

View GitHub Profile
function [seg] = im_to_snake(mov, seg, in_im_us)
flag_thresh = 0.15;
its = 5;
% Default is to _not_ create an avi
if nargin < 1
mov = 0;
end
@mattfoster
mattfoster / gist:19441
Created October 24, 2008 14:35
packages for ieee grsl
\usepackage{cite}
\usepackage[pdftex]{graphicx}
\usepackage{textcomp}
\usepackage[cmex10]{amsmath}
\interdisplaylinepenalty=2500
\usepackage{array}
\usepackage[font=footnotesize]{subfig}
\usepackage{url}
\usepackage{textcase}
\usepackage{acronym}
#!/usr/bin/env python
from enthought.traits.api \
import HasTraits, Array, Range, Float, Enum, on_trait_change, Property
from enthought.traits.ui.api import View, Item
from enthought.chaco.chaco_plot_editor import ChacoPlotItem
from numpy import arange
from numpy import sin,pi
class Data(HasTraits):
#!/usr/bin/env python
from enthought.traits.api import *
from enthought.traits.ui.api import *
from enthought.chaco.api import *
from enthought.enable.component_editor import ComponentEditor
from enthought.chaco.chaco_plot_editor import ChacoPlotItem
from numpy import arange
from numpy import sin, cos, pi
plot(-pi:0.1:pi, sin(-pi:0.1:pi)./-pi:0.1:pi, -pi:0.1:pi, cos(-pi:0.1:pi), 'linewidth', 2)
t = -pi:0.1:pi;
plot(t, sin(t)./t, t, cos(t), 'linewidth', 2)
from IPython.ColorANSI import TermColors
colors = TermColors()
print 'IPython Colors:'
for color in dir(colors):
if not color.startswith('_'):
print getattr(colors, color), color
print colors.Blue, 'blue', colors.Red, 'green'
#!/usr/bin/env python
# Add comments to the end of lines
# Set `save` to `nothing`
# Set `input` to `selected text` or `line`
# Set `output` to `replace selected text`
import sys, os
comment_char = os.environ.get('TM_COMMENT_START', '#')
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>commands</key>
<array>
<dict>
<key>argument</key>
<dict>
<key>beforeRunningCommand</key>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>commands</key>
<array>
<dict>
<key>argument</key>
<dict>
<key>beforeRunningCommand</key>