Skip to content

Instantly share code, notes, and snippets.

View jtzemp's full-sized avatar

JT Zemp jtzemp

  • SF Bay Area, CA, USA
View GitHub Profile

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 December 12, 2013 20:49
http://onestepback.org/index.cgi/Tech/Ruby/WEBrick.rdoc with a change to use /usr/bin/env ruby instead of /usr/local/bin/ruby
#!/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 November 13, 2013 21:22
Ruby-based date dimension builder using a Kimball-ish pattern.
#!/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),
#!/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')
# 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