Skip to content

Instantly share code, notes, and snippets.

View hauselin's full-sized avatar

Hause Lin hauselin

View GitHub Profile
@squarefrog
squarefrog / alfred-query-test.py
Created June 17, 2015 13:19
Workaround for multiline Alfred input in a Python workflow
'''
Pasting in multiline text, eg:
This is
some text
fails when using the following, Alfred provided starting point.
'''
# Breaks ALL the things..
query = '{query}'
@wmvanvliet
wmvanvliet / faster.py
Last active January 22, 2022 10:32
First, second and third steps of the FASTER algorithm
import numpy as np
import scipy.signal
import mne
from scipy.stats import kurtosis
from mne.preprocessing import find_outliers
from mne.fixes import nanmean
from mne.utils import logger
#from mne.preprocessing.eog import _get_eog_channel_index
@hofmannsven
hofmannsven / README.md
Last active April 30, 2025 15:25
Git CLI Cheatsheet
@igrigorik
igrigorik / github.bash
Last active October 23, 2024 10:43
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep [email protected] | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
@elentok
elentok / fl
Created August 13, 2013 07:47
Open forklift from terminal
#!/bin/bash
# Open current directory in forklift
echo -n $PWD | pbcopy
(cat<<EOF
tell application "Forklift"
activate
tell application "System Events"
@nicolashery
nicolashery / poisson.js
Created June 28, 2013 14:52
Quick JavaScript implementation of Exponential and Geometric random number generators
/* Quick implementation of Exponential and Geometric random number generators
For example you can use it to simulate when an event is going to happen next, given its average rate:
Buses arrive every 30 minutes on average, so that's an average rate of 2 per hour.
I arrive at the bus station, I can use this to generate the next bus ETA:
randomExponential(2); // => 0.3213031016466269 hours, i.e. 19 minutes
*/