Skip to content

Instantly share code, notes, and snippets.

View leemartin's full-sized avatar

Lee Martin leemartin

View GitHub Profile
@kevincennis
kevincennis / bounce.js
Created July 13, 2013 02:17
Bounce an AudioBuffer to WAV with RecorderWorker.js
// assuming you have an AudioBuffer instance called `buffer`,
// and an AudioContext (or OfflineAudioContext) called `ctx`...
// create a new Worker...
var worker = new Worker('recorderWorker.js');
// get it started and send some config data...
worker.postMessage({
command: 'init',
@jhollinger
jhollinger / dropbox.css
Created July 27, 2012 05:27
Dropbox - async, ajax uploads with HTML5 in Sinatra
#dropbox {
position: relative;
}
#dropbox > input {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
@brainix
brainix / install_do_postgres.sh
Last active January 3, 2016 13:19
Install the do_postgres gem with Postgres.app
gem install do_postgres -- \
--with-pgsql-server-dir=/Applications/Postgres.app/Contents/Versions/9.3 \
--with-pgsql-server-include=/Applications/Postgres.app/Contents/Versions/9.3/include/postgresql/server
@mattetti
mattetti / gist:1318670
Created October 27, 2011 02:48
google cloud print pointers
client = OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET,
:authorize_url => "/o/oauth2/auth",
:access_token_url => "/o/oauth2/token",
:site => 'https://accounts.google.com/')
get '/auth' do
url = client.web_server.authorize_url(
:redirect_uri => redirect_uri,
:scope => 'https://www.googleapis.com/auth/cloudprint',
:response_type => "code"
@mazuhl
mazuhl / application_controller.rb
Created January 8, 2010 16:19
Putting together a traffic analytics model and controller for a Ruby on Rails app based on this presentation about Scribd http://www.scribd.com/doc/49575/Scaling-Rails-Presentation-From-Scribd-Launch (see slides 17 to 22).
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
# filter_parameter_logging :password
before_filter :log_page_view, :except => [:destroy]
private