Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View AndreasBriese's full-sized avatar

Andreas Briese AndreasBriese

View GitHub Profile
@AndreasBriese
AndreasBriese / peakdetect.py
Created February 28, 2016 15:59 — forked from sixtenbe/analytic_wfm.py
Peak detection in Python
import numpy as np
from math import pi, log
import pylab
from scipy import fft, ifft
from scipy.optimize import curve_fit
i = 10000
x = np.linspace(0, 3.5 * pi, i)
y = (0.3*np.sin(x) + np.sin(1.3 * x) + 0.9 * np.sin(4.2 * x) + 0.06 *
np.random.randn(i))
func populateStdin(file []byte) func(io.WriteCloser) {
return func(stdin io.WriteCloser) {
defer stdin.Close()
io.Copy(stdin, bytes.NewReader(file))
fmt.Println("copied ok")
}
}
func audio_m4a2mp3(data []byte) ([]byte, error) {
binary, lookErr := exec.LookPath("ffmpeg")

This gist is the source code for http://gary.beagledreams.com/page/go-websocket-chat.html

Copyright (c) 2013 Gary Burd

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@AndreasBriese
AndreasBriese / underscoreAddon.js
Created January 24, 2012 14:45
underscore addon -> sum, mean, median, nrange
// underscore addon with sum, mean, median and nrange function
// see details below
_.mixin({
// Return sum of the elements
sum : function(obj, iterator, context) {
if (!iterator && _.isEmpty(obj)) return 0;
var result = 0;
if (!iterator && _.isArray(obj)){