Skip to content

Instantly share code, notes, and snippets.

View davidteren's full-sized avatar
👋
Hey, nice to meet you.

David Teren davidteren

👋
Hey, nice to meet you.
View GitHub Profile
@davidteren
davidteren / transcribe-whisper-1.rb
Created November 9, 2024 16:25 — forked from swombat/transcribe-whisper-1.rb
Transcribe via whisper-1
#!/usr/bin/env ruby
require 'open3'
require 'signal'
require 'openai'
# Define the silence threshold and duration for detection
@silence_threshold = '-30dB'
@silence_duration = 0.5
@davidteren
davidteren / tailwind_class_builder.rb
Last active July 13, 2024 03:20 — forked from searls/tailwind_class_builder.rb
Here's a custom Tailwind FormBuilder for Rails. To set this up, just set ` ActionView::Base.default_form_builder = FormBuilders::TailwindFormBuilder` somewhere (and customize all the CSS classes)
class TailwindClassBuilder
include ActionView::Helpers::TagHelper
def button_classes(options)
button_type = options.delete(:button_type) { :button }
class_names(
# general classes
"mt-4 px-1 sm:px-3 py-sm sm:py-1 font-semibold bg-transparent border rounded",
case button_type