Skip to content

Instantly share code, notes, and snippets.

View brapse's full-sized avatar

Sean Braithwaite brapse

View GitHub Profile
(
SynthDef(\player, {|out=0,rate=1,bufNum, amp=1, noise=0.1, delay=3,dur=10|
var ctl,sig;
sig = BufRd.ar(1, bufNum,
Phasor.ar(0, BufRateScale.kr(bufNum)*rate, 0, BufFrames.kr(bufNum));
);
//sig= (WhiteNoise.kr(0.25) * (1+noise)) * sig;
sig = Mix.ar(Array.fill(4,{ CombL.ar(sig, 0.1, 0.2, delay) }));
(define (fizz-buzz rng)
(let loop ((n 1))
(let ((thr (remainder n 3))
(fiv (remainder n 5)))
(cond
((and (zero? thr) (zero? fiv)) (printf “fizz-buzz~n”))
((zero? thr) (printf “fizz~n”))
((zero? fiv) (printf “buzz~n”))
(else (printf “~a~n” n)))
(if (= rng n)
From 150ef696a4d821a648880ea8f355acbc28e06f4a Mon Sep 17 00:00:00 2001
From: Sean Braithwaite <[email protected]>
Date: Tue, 12 May 2009 22:12:00 -0400
Subject: [PATCH] Typo in gem rake task
---
do_sqlite3/tasks/gem.rake | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/do_sqlite3/tasks/gem.rake b/do_sqlite3/tasks/gem.rake
Datamapper is an ruby (MRI, YARV, JRuby) Object Relational Mapper (ORM) comparable to Sequel or ActiveRecord. Unlike it's comparables, datamapper is becoming increasingly data store agnostic. Not only can it be used to avoid writing sql, but is aiming to define a general language for object storage. This talk aims to present the recent developments in dm-core/next branch and what these changes have to offer developers working with multiple non relational data stores.
@brapse
brapse / gist:115897
Created May 22, 2009 03:07
debug with pp
###########################
#VIEW
##########################
<h1>Request password reset</h1>
<%= flash[:notice] %>
<%= flash[:error] %>
<%= error_messages_for :user %>
<p>Have you forgotten your password? Don't worry, simply enter your email address below and we will send you a link to enable you to reset your password.</p>
Undefined symbols:
"_curl_easy_perform", referenced from:
postTwitter(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in ccTLU0tl.o
"_curl_easy_setopt", referenced from:
postTwitter(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in ccTLU0tl.o
postTwitter(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in ccTLU0tl.o
postTwitter(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in ccTLU0tl.o
postTwitter(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in ccTLU0tl.o
postTwitter(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in ccTLU0tl.o
postTwitter(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in ccTLU0tl.o
//@jpalardy knows closures
var filterFormFields = (function() {
var mapping = { "0" : "c_refinance",
"1" : "c_home_equity"
"2" : "c_dept_consolidation",
"3" : "c_new_home_purchase" };
return function() {
jQuery("#searchbox > div").hide();
target = mapping[jQuery("#reason").val()];
capture do |emit|
emit.call 'FIXED-10', table[2][1], :ltv_max => 0.75
emit.call 'FIXED-15', table[3][1], :ltv_max => 0.75
emit.call 'FIXED-20', table[4][1], :ltv_max => 0.75
emit.call 'FIXED-30', table[5][1], :ltv_max => 0.75
table = tables[3]
emit.call 'ARM-1', table[2][1], :ltv_max => 0.75
emit.call 'ARM-3', table[3][1], :ltv_max => 0.75
class Table
def initialize(selector, document)
@table = document.search(selector).search("tr").map do |tr|
tr.search("th, td").map do |td|
td.inner_text.strip.gsub(/&#036;/, '$')
end.first
end
# confirms it's a table
unless @table.is_a?(Array) && @table.first.is_a?(Array)
raise UnAdaptedError.new("table parsing failed")
Hipdoop::adapt(:name => "National City", :cert => 6557) do
url = 'http://www.nationalcityhomeloans.com/QuickRates/QuickRates.aspx?AppType=1&LoanAmount=250000&ZipCode=90210'
document = fetch_document(url)
table = Hipdoop::Table.new('table.rateSection:nth(0)', document)
emit 'FIXED-10', table[2][1], :ltv_max => 0.75
emit 'FIXED-15', table[3][1], :ltv_max => 0.75
emit 'FIXED-20', table[4][1], :ltv_max => 0.75
emit 'FIXED-30', table[5][1], :ltv_max => 0.75