Skip to content

Instantly share code, notes, and snippets.

View sulmanweb's full-sized avatar

Sulman Baig sulmanweb

View GitHub Profile
@schappim
schappim / summarize_youtube.rb
Created January 3, 2025 00:57
A ruby script to summarize YouTube videos
#!/usr/bin/env ruby
# frozen_string_literal: true
# This script downloads the English auto-generated subtitles for a YouTube video,
# converts them to a single text block, and sends them to OpenAI for summarization.
# Requirements:
# - yt-dlp (brew install yt-dlp)
# - OpenAI Ruby gem (gem install 'ruby-openai')
# - An OpenAI API key set as an environment variable (export OPENAI_API_KEY=your-api-key)
@gudongfeng
gudongfeng / test_adapter.rb
Last active April 24, 2018 14:07
Rails ActionCable Channel Rspec test
# spec/channels/stubs/test_adapter.rb
class SuccessAdapter < ActionCable::SubscriptionAdapter::Base
def broadcast(channel, payload)
end
def subscribe(channel, callback, success_callback = nil)
end
def unsubscribe(channel, callback)
end