Skip to content

Instantly share code, notes, and snippets.

@feliperaul
feliperaul / #ChatGPT Streaming.md
Created August 9, 2024 15:17 — forked from alexrudall/#ChatGPT Streaming.md
ChatGPT streaming with ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind!

How to add ChatGPT streaming to your Ruby on Rails 7 app!

This guide will walk you through adding a ChatGPT-like messaging stream to your Ruby on Rails 7 app using ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind. All code included below!

Want more content like this, for free? Check out my free book, RailsAI!

Alt Text

@feliperaul
feliperaul / input_somente_numerico.js
Created May 1, 2018 03:22
Input somente numérico
$('[data-behavior="input_field"]').on('input', function () {
$(this).val( $(this).val().replace(/\D/g,'') )
})