Running with patch
$ QUEUE_ADAPTER=async ./fix-preview-image-race-condition.rb
Yields
Creating a post and uploading a video
const css4ColorsToLegacyRgbaPlugin = { | |
postcssPlugin: 'these-colors-dont-run', | |
Once (root) { | |
root.walkDecls((decl) => { | |
const rgbRegex = /rgb\((\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s*(?:\/\s*(\d+\.?\d*))?\)/g | |
decl.value = decl.value.replace(rgbRegex, (match, r, g, b, a) => { | |
if (!a || a === '1' || a === '1.0') { | |
return `rgb(${r}, ${g}, ${b})` | |
} else { | |
return `rgba(${r}, ${g}, ${b}, ${a})` |
# Leverages the BroadcastLogger introduced in Rails 7.1 to wrap the current | |
# logger in a new logger that broadcasts to both the current logger and $stdout | |
# | |
# (Announcement: https://rubyonrails.org/2023/9/29/this-week-in-rails) | |
# | |
# If the current logger already broadcasts to $stdout, it will not be wrapped, | |
# making it safe to call this method multiple times without knowing the current | |
# logging "sitch". | |
# | |
# Usage probably looks something like this: |
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(/[email protected]:(.*).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 |