This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Circular-linear correlation for regressing onto circular phase variables | |
based on the method established by: | |
Kempter R, Leibold C, Buzsáki G, Diba K, Schmidt R. Quantifying | |
circular-linear associations: hippocampal phase precession. | |
J Neurosci Methods. 2012;207(1):113–24. | |
doi:10.1016/j.jneumeth.2012.03.007. | |
Implemented By: @jdmonaco (github) / @j_d_monaco (twitter) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Spike train cross-correlogram methods. | |
""" | |
import time | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy import real | |
from scipy.fftpack import fft, ifft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Limited-lag numpy implementation of spike train cross-correlation. | |
""" | |
import numpy as np | |
def xcorr(a, b, maxlag=1.0, bins=128): | |
""" | |
Compute the cross-correlogram of two spike train arrays. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p ~/Library/Desktop\ Pictures | |
cd ~/Library/Desktop\ Pictures | |
find /Library/Desktop\ Pictures/ -size +1M -name "*.jpg" -exec ln -s "{}" . \; 2>/dev/null | |
find /Library/Screen\ Savers/ -size +1M -name "*.jpg" -exec ln -s "{}" . \; 2>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript | |
on run argv | |
set mateScript to "mate -l " & item 1 of argv & " " & item 2 of argv | |
tell application "Terminal" | |
set thisTab to do script mateScript | |
set visible of window 1 to false | |
delay 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
organize-photos.py - Organize an unstructured folder tree of photos and movie | |
files into a month-and-year folder structure. | |
Note: This is a minor rewrite of @cliss's extension [1,2] of @drdrang's | |
photo management scripts [3], and includes a tweak from @jamiepinkham [4,5]. | |
The lists of raw [6] and video [7] file extensions were found elsewhere. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert -delay %filltext:name=delay x0.01s:default=10:width=2% -resize %filltext:name=width:default=256:width=3% %filltext:name=glob:default=IMG*.JPG% %filltext:name=output:default=output.gif% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
import numpy as np | |
import scipy.stats as st | |
TtestResults = namedtuple("Ttest", "T p") | |
def t_welch(x, y, tails=2): | |
""" | |
Welch's t-test for two unequal-size samples, not assuming equal variances |
NewerOlder