Skip to content

Instantly share code, notes, and snippets.

View bdyetton's full-sized avatar

Benjamin Yetton bdyetton

  • Facebook
  • United States
View GitHub Profile
@KenoLeon
KenoLeon / PyAudio_Stream_Non_Blocking.py
Created April 16, 2021 20:59
PyAudio Non Blocking Stream for Microphone
import pyaudio
import time
import numpy as np
"""Simple Non Blocking Stream PyAudio"""
CHUNK = 1024 # Samples: 1024, 512, 256, 128 frames per buffer
RATE = 44100 # Equivalent to Human Hearing at 40 kHz
INTERVAL = 1 # Sampling Interval in Seconds
@bwengals
bwengals / gp_poisson.ipynb
Created March 19, 2017 10:13
poisson gp regression of old faithful histogram data fitted with pymc3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fredcallaway
fredcallaway / stochastic_matrix.py
Created November 10, 2016 06:11
Stochastic matrix in pymc3
import numpy as np
import pymc3 as pm
import theano
class StochasticMatrix(pm.Continuous):
"""A stochastic matrix has rows that sum to 1."""
def __init__(self, theta, *args, **kwargs):
shape = (theta.shape[-1], theta.shape[-1])
kwargs.setdefault('shape', shape)
super(StochasticMatrix, self).__init__(*args, **kwargs)
@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
@lmacken
lmacken / countdown.py
Last active March 29, 2022 11:45
A fullscreen countdown timer
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# A fork of pyglet's timer.py by Luke Macken
#
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: