Skip to content

Instantly share code, notes, and snippets.

View rht's full-sized avatar

rht

  • ◊ Mars
View GitHub Profile
@rht
rht / trivial_file_upload_service.rb
Created March 1, 2012 03:31 — forked from gavinheavyside/trivial_file_upload_service.rb
Trivial file upload service using Sinatra
require 'rubygems'
require 'sinatra'
require 'fileutils'
# upload with:
# curl -v -F "data=@/path/to/filename" http://localhost:4567/user/filename
post '/:name/:filename' do
userdir = File.join("files", params[:name])
@rht
rht / peakdetect.py
Created April 14, 2012 18:21 — 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))