Skip to content

Instantly share code, notes, and snippets.

Avatar

JT Zemp jtzemp

  • SF Bay Area, CA, USA
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jtzemp on github.
  • I am jtz (https://keybase.io/jtz) on keybase.
  • I have a public key whose fingerprint is 4E9F D2A3 5D30 FCB3 2E94 C5FF 0178 C998 B2A4 3B9D

To claim this, I am signing this object:

@jtzemp
jtzemp / servefiles.rb
Created Dec 12, 2013
http://onestepback.org/index.cgi/Tech/Ruby/WEBrick.rdoc with a change to use /usr/bin/env ruby instead of /usr/local/bin/ruby
View servefiles.rb
#!/usr/bin/env ruby
require 'webrick'
include WEBrick
dir = Dir::pwd
port = 12000 + (dir.hash % 1000)
url = "http://#{Socket.gethostname}:#{port}"
puts "URL: #{url}"
@jtzemp
jtzemp / date_dimension_builder.rb
Created Nov 13, 2013
Ruby-based date dimension builder using a Kimball-ish pattern.
View date_dimension_builder.rb
#!/usr/bin/env ruby
require 'date'
# create table dim_date (
# date_key int primary key not null,
# full_date date,
# unix_timestamp int,
# year int,
# month_number int,
# month_name varchar(255),
# month_name_short varchar(255),
View Ruby FFT of .wav Test.rb
#!/user/bin/env ruby
require 'rubygems'
require 'wavefile'
require 'fftw3'
require 'fastercsv'
# needs to be mono, or you'll need to discard a channel, or combine channels
w = WaveFile.open('sample.wav')
View gist:175710
# code
class ExternalDataApi
def initialize(setup)
# do stuff to setup
end
def list_of_things
# grabs stuff from the api and returns an array of OStructs
end
end