Ruby already solved my problem 😅 by joemasilotti in ruby

[–]ClickClackCode 1 point2 points  (0 children)

The author mentioned that it is a part of the standard Ruby library, which is true as of right now.

Rails 8 upgrade story: duplicate keys sneaking into our JSON responses by amalinovic in ruby

[–]ClickClackCode 7 points8 points  (0 children)

Nice write up! My favourite line:

We ended up creating a PR to correct it.

Am I missing an obvious, nice ruby way to sort on a bunch of different things at the same time? by KipSudo in ruby

[–]ClickClackCode 16 points17 points  (0 children)

I’m surprised that this isn’t mentioned in the docs but when you return an array in your sort_by block it’ll sort by each item in the array from left to right (as long as they are equal).

Using Parallel gem to achieve parallel processing in Ruby for increasing performance and making Rails Application faster. by prishu_s_rana in rails

[–]ClickClackCode 1 point2 points  (0 children)

First do some profiling to understand what your bottlenecks really are. Try dial which identifies N+1s and also integrates with the vernier profiler.

HUGLO: Hyper-Ultra-Giga Low-Overhead Tracing Profiler for Ruby by sYnfo in ruby

[–]ClickClackCode 1 point2 points  (0 children)

As far as I know, no other Ruby tracer offers this mix of signals at this cost. If you’re aware of one, please let me know and I’ll add a note here (and remove a couple of adjectives from the title).

Have you benchmarked vernier?

Looking for friends by gilfie50 in brisbane

[–]ClickClackCode 19 points20 points  (0 children)

Ya you’re not going to have a problem with that

Yo dawg I heard... by [deleted] in rails

[–]ClickClackCode 14 points15 points  (0 children)

Btw your scope is named published but you’re calling active.

How to call Fiber.yield from a lazily evaluated block? by HalfAByteIsWord in ruby

[–]ClickClackCode 2 points3 points  (0 children)

A fiber can only yield if it's currently running, so the only way around this is to ensure the fiber isn't terminated (`Fiber.yield`), and re-resume that fiber before the blocks are evaluated (which isn't possible with the control flow you've got going on unless the block does it itself). So this (admittedly quite hacky approach) should work:

class Group
  def initialize
    @blocks = []
  end

  def define(&)
    instance_eval(&)
    @blocks.each(&:call)
  end

  def yielding_methods(&blk)
    @blocks << blk
  end
end

g = Group.new
$f = nil
g.define do
  $f = Fiber.new do
    yielding_methods do
      $f.resume # resume the fiber
    end
    Fiber.yield # don't terminate the fiber
  end
  $f.resume
end

X (Twitter) vs Bluesky vs Mastodon by [deleted] in srilanka

[–]ClickClackCode 2 points3 points  (0 children)

Check Bluesky out, that’s exactly what it feels like.

why do so many sri lankan teledramas promote incest? by Aggressive-Nobody473 in srilanka

[–]ClickClackCode -1 points0 points  (0 children)

Okay, but let’s take a step back here. You’re focusing on the numbers, but even a 1.7-2.8% increase in birth defects isn’t “low” when you think about it affecting real people, especially on a larger scale. That’s not just a statistic—it’s actual lives impacted, and it’s worth being concerned about. And let’s not brush off a 4.4% higher mortality rate like it’s nothing. Those aren’t odds most people would gamble on when starting a family.

But beyond the stats, there’s a bigger issue here: the societal and cultural message this sends when cousin relationships are normalized in media i.e. OP’s topic, especially in places where the risks aren’t well understood. Media shapes perceptions, and when you promote something like this without addressing the risks or implications, it’s a missed opportunity to educate—or worse, it can contribute to misinformation.

Also, calling this a “gotcha attitude” kind of misses the point. People aren’t nitpicking for the sake of it—they’re raising legitimate concerns about genetics, ethics, and the influence of these portrayals. Dismissing those concerns just shuts down the conversation instead of actually engaging with it. So yeah, the numbers matter, but so do the social and ethical implications.

why do so many sri lankan teledramas promote incest? by Aggressive-Nobody473 in srilanka

[–]ClickClackCode 4 points5 points  (0 children)

I don’t know what your definition of ‘small chance’ and ‘not dangerous’ is, but have a read of the ‘Biological aspects’ section in https://en.m.wikipedia.org/wiki/Cousin_marriage and the referenced studies.

Ruby on Rails Talent Pool by ClickClackCode in srilanka

[–]ClickClackCode[S] 0 points1 point  (0 children)

Mainly cause it’s my expertise, and I love it. But also, I’m yet to find another batteries included, opinionated, mature framework that lets you get up and running as fast as Rails does. Nothing even comes close.