Running with patch
$ QUEUE_ADAPTER=async ./fix-preview-image-race-condition.rb
Yields
Creating a post and uploading a video
Running with patch
$ QUEUE_ADAPTER=async ./fix-preview-image-race-condition.rb
Yields
Creating a post and uploading a video
TIL this script helped me figure out that
Not awesome things that happen in this case:
| class FeedsController < ApplicationController | |
| def index | |
| @posts = Post.with_visuals.order(published_at: :desc) | |
| end | |
| end |
| #!/usr/bin/env ruby | |
| begin | |
| repo = `git remote -v`.split("\n").find { |line| | |
| line.include?("github.com") | |
| }.split("\t")[1].match(/git@github.com:(.*).git/)[1] | |
| system "open https://github.com/#{repo}" | |
| rescue | |
| warn "No github remote found" |
| ~/code/searls/spreadsheetify $ ./script/run | |
| Let's define columns. | |
| Column name: | |
| > Name | |
| Column description: (optional) | |
| > | |
| More columns? [Yn] | |
| > |
| WORKDAY_HOURS = 8 | |
| LOOP_SPEED = 15 | |
| INCORRECT_EVERY = 25 | |
| LOW_FIDELITY_EVERY = 10 | |
| INCORRECT_LOOP_PENALTY = 3 | |
| LOW_FIDELITY_TIME_PENALTY = 2 | |
| time_remaining = WORKDAY_HOURS * 60 * 60 |
| # Override Sorbet's runtime checks inside a given block's execution to allow | |
| # testing of, among other things, Mocktail's own runtime type checks. | |
| # See doc: https://sorbet.org/docs/tconfiguration | |
| # | |
| # Note that the messages being raised are the same as those constructed in | |
| # sorbet-runtime (0.5.10847) | |
| # | |
| # Example usage: | |
| # def test_not_a_class | |
| # e = SorbetOverride.disable_call_validation_checks do |
| # typed: true | |
| # This script prints: | |
| # | |
| # <-- Stubbing based on kwarg comparison with a TYPED method | |
| # Should be tim: "jan greeting" | |
| # Should be jan: "jan greeting" | |
| # Should be nil: "jan greeting" | |
| # <-- Stubbing based on kwarg comparison with an UNTYPED method |
| Welcome to Matsumoto. I mean, physically or virtually. We're so happy to have you here. I think I'm seeing a thousand people in front of me here in this venue. I think it's been a while. It's been a while. It's been like four years since we had this number of people in the Kaigi venue. Four years. I'd like to say thank you for gathering again, coming back to RubyKaigi. I feel like the Kaigi is back. Because of you. Because of you, in the venue. Because you are back. But actually, since there have been four years of blank period of Kaigi, I said you're back, but actually we should be having newcomers to the Kaigi. So, please let me know. Please tell me, who are the first-timers of RubyKaigi? I mean, raise your hand if you are coming to RubyKaigi for the first time. Thank you. Thank you for coming. We really welcome your attendance. So, one thing I'd like to tell you, I have to tell you is... Um... Not that. The COC thing, the Code of Conduct, the core of the conduct is be nice to each other. So, let us be nice |
| require_relative "../config/environment" | |
| uri = URI("https://api.openai.com/v1/chat/completions") | |
| req = Net::HTTP::Post.new(uri) | |
| req["Content-Type"] = "application/json" | |
| req["Authorization"] = "Bearer #{ENV["OPEN_AI_API_KEY"]}" | |
| req.body = JSON.dump({ | |
| model: "gpt-4", | |
| max_tokens: 80, | |
| messages: [{role: "user", content: "What's the best way to learn Ruby?"}], |