Skip to content

Instantly share code, notes, and snippets.

View mmagnuski's full-sized avatar

Mikolaj Magnuski mmagnuski

View GitHub Profile
@jpoehls
jpoehls / output.txt
Created March 26, 2012 16:48
PowerShell benchmarking function. Or, the Windows equivalent of Unix's `time` command.
PS> time { ping -n 1 google.com } -Samples 10 -Silent
..........
Avg: 62.1674ms
Min: 56.9945ms
Max: 87.9602ms
PS> time { ping -n 1 google.com } -Samples 10 -Silent -Long
..........
Avg: 00:00:00.0612480
Min: 00:00:00.0572167
@minrk
minrk / ipnbdoctest.py
Last active September 14, 2023 11:23
simple example script for running and testing notebooks.
#!/usr/bin/env python
"""
simple example script for running and testing notebooks.
Usage: `ipnbdoctest.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and the outputs are compared with those stored in the notebook.
"""
# License: Public Domain, but credit is nice (Min RK).
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@agramfort
agramfort / circular_data_functions.py
Created November 10, 2012 18:19
basic circular stats
"""
=========================================================
circular data analysis functions
=========================================================
"""
# Authors : Anne Kosem and Alexandre Gramfort
# License : Simplified BSD
@gizmaa
gizmaa / Plot_Examples.md
Last active June 10, 2024 02:44
Various Julia plotting examples using PyPlot
@milktrader
milktrader / fastmoving.jl
Last active January 3, 2016 11:49
Turbo boosting the moving method with Iterators (h/t Slender Means)
julia> using Series, MarketData, FactCheck
julia> @time fast = fastmoving(Cl, mean, 60);
elapsed time: 0.305857977 seconds (72646744 bytes allocated)
julia> @time slow = moving(Cl, mean, 60);
elapsed time: 4.925385985 seconds (2079575504 bytes allocated)
julia> @fact fast[end].value => roughly(slow[end].value)
Success :: :(fast[end].value) => :(roughly(slow[end].value))
@agramfort
agramfort / pdc_dtf.py
Created March 30, 2014 16:33
Partial Directed Coherence and Direct Transfer Function using MVAR processes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements Partial Directed Coherence and Direct Transfer Function
using MVAR processes.
Reference
---------
Luiz A. Baccala and Koichi Sameshima. Partial directed coherence:
a new concept in neural structure determination.
@kingjr
kingjr / circular_linear_correlation.py
Created June 3, 2015 00:40
circular_linear_correlation
def circular_linear_correlation(alpha, x):
# Authors: Jean-Remi King <jeanremi.king@gmail.com>
# Niccolo Pescetelli <niccolo.pescetelli@gmail.com>
#
# Licence : BSD-simplified
"""
Parameters
----------
alpha : numpy.array, shape (n_angles, n_dims)
@wmvanvliet
wmvanvliet / topomap_skirt_demo.py
Created August 12, 2015 15:41
Demonstration of the new outline='skirt' functionality
# Python
import mne
import numpy as np
from matplotlib import pyplot as plt
# Channel positions
ch_names = ['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10', 'A11', 'A12', 'A13', 'A14', 'A15', 'A16', 'A17', 'A18', 'A19', 'A20', 'A21', 'A22', 'A23', 'A24', 'A25', 'A26', 'A27', 'A28', 'A29', 'A30', 'A31', 'A32', 'B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B9', 'B10', 'B11', 'B12', 'B13', 'B14', 'B15', 'B16', 'B17', 'B18', 'B19', 'B20', 'B21', 'B22', 'B23', 'B24', 'B25', 'B26', 'B27', 'B28', 'B29', 'B30', 'B31', 'B32', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9', 'C10', 'C11', 'C12', 'C13', 'C14', 'C15', 'C16', 'C17', 'C18', 'C19', 'C20', 'C21', 'C22', 'C23', 'C24', 'C25', 'C26', 'C27', 'C28', 'C29', 'C30', 'C31', 'C32', 'D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'D10', 'D11', 'D12', 'D13', 'D14', 'D15', 'D16', 'D17', 'D18', 'D19', 'D20', 'D21', 'D22', 'D23', 'D24', 'D25', 'D26', 'D27', 'D28', 'D29', 'D30', 'D31', 'D32']
montage = mne.channels.read_montage('biosemi128')
info
@MattDMo
MattDMo / ipy_repl.py
Last active April 3, 2022 23:16
SublimeREPL ipy_repl.py for running IPython/Jupyter in Sublime Text
# from https://gist.github.com/MattDMo/6cb1dfbe8a124e1ca5af
import os
import json
import socket
import threading
activate_this = os.environ.get("SUBLIMEREPL_ACTIVATE_THIS", None)
# turn off pager