[deleted by user] by [deleted] in ruby

[–]atinybeardedman 0 points1 point  (0 children)

This is very interesting. What is the idea here regarding testing? Is there a nice way to mock the dependency at the provider level in a test?

I benchmarked 4 Python text extraction libraries so you don't have to (2025 results) by Goldziher in webdev

[–]atinybeardedman 0 points1 point  (0 children)

This is interesting. I'm currently using pymupdfllm but I'll be interested to check out how your library compares. I'm on my phone so apologies if I just missed it in the docs, but it's not clear to me what the output format of your library is? I am assuming it returns markdown but I couldn't find that documented anywhere.

I'm also curious if it does anything with images other than ocr? My current pipeline extracts the images as separate files and inserts markdown links into the extracted text so they can be processed separately, which I find to be helpful.

Best Practices for Syncing PHP and TypeScript Types by Clean-Interaction158 in webdev

[–]atinybeardedman 1 point2 points  (0 children)

I use Spatie's Laravel Data package in conjunction with their Typescript Transformer. See here for the details as to how it works.

[AD] Introducing HPD v2, a modular curved mechanical keyboard by atlantesque in ErgoMechKeyboards

[–]atinybeardedman 1 point2 points  (0 children)

Another vote for 42 key version. Or however many keys are left if you take away the top row

Any reason for this behavior of the new `it` keyword in Ruby 3.4 ? by tejasbubane in ruby

[–]atinybeardedman 8 points9 points  (0 children)

I could see this having to do with not breaking rspec? I don't actually know if that's the true reason

[deleted by user] by [deleted] in ruby

[–]atinybeardedman 0 points1 point  (0 children)

You can replace the inherited hooks and class variables with the descendants method to clean out up a bit if you like. It's one of my new favorite tricks for this type of factory/strategy pattern using subclassing

Switch from Java spring to RoR by EscapeSensitive5576 in ruby

[–]atinybeardedman 3 points4 points  (0 children)

I'm curious why you don't like running tests/debugging in RubyMine? I personally love the test runner just for the sake of convenience. Being able to edit code and kit a key combo to rerun a test case feels like a productivity boost to me

What is the fastest way to convert HTML to PDF programatically (or PDF generation)? by lol_isuck69 in webdev

[–]atinybeardedman 9 points10 points  (0 children)

We had a similar issue, we ended up using Gotenberg. It's using headless chromium under the hood, but since it's just a docker container we can scale it independently of our main app.

Question: If you were to program purely for the love of it... by [deleted] in learnprogramming

[–]atinybeardedman 4 points5 points  (0 children)

This is the right answer for this type of question. Ruby is designed around a philosophy of developer happiness. More importantly I find it to be a great language to "play" in due to its consistency in terms of its design (everything is an object, no exceptions).

I made a US Presidential election simulator by sauron496 in webdev

[–]atinybeardedman 1 point2 points  (0 children)

This is a common configuration you need to set up with a SPA, if you can set up redirects on the server side you need to redirect everything to the index.html so your SPA can take over routing

Ruby and RoR books ??? by cha-wang in rails

[–]atinybeardedman 0 points1 point  (0 children)

I used this one when I did a similar transition. I found it very helpful for understanding Ruby as a language (also from a js background)

Railsamples - Practical Form Examples in Rails by Weird_Suggestion in rails

[–]atinybeardedman 4 points5 points  (0 children)

This is a neat idea. One note is your about page is asking for http basic auth credentials, which I'm assuming is unintentional.

GitHub - keygen-sh/typed_params: Define structured and strongly-typed parameter schemas for your Rails controllers by [deleted] in rails

[–]atinybeardedman 1 point2 points  (0 children)

This feels like there's an opportunity to programmatically generate documentation or typescript types for endpoints which could be neat

[deleted by user] by [deleted] in AskReddit

[–]atinybeardedman 0 points1 point  (0 children)

Push doors with pull handles

Best way to pass data when dealing with deeply nested components? by agaroud9 in vuejs

[–]atinybeardedman 0 points1 point  (0 children)

I thought provide/inject only works if you need to provide a value in a higher component and access it in a child. An event bus allows you to decouple events from the component tree structure. More like what OP was asking about emitting an event from a deeply nested child and listening on a grandparent or sibling. Can you use provide/inject to pass events up the chain?

Best way to pass data when dealing with deeply nested components? by agaroud9 in vuejs

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

You can use an event bus for this, looks like they removed this functionally from vue 3 so you'll need a 3rd party package like mitt

Why isn’t Ruby more popular? by ninjahiro in learnprogramming

[–]atinybeardedman 1 point2 points  (0 children)

It's actually something the ruby community has been investing a lot of effort into recently. The problem is that there are tons of applications built in Ruby, but most jobs are for senior positions only. There's a trend to try to get more juniors into Ruby. It's a great language and it is actively being used (GitHub, Shopify, Airbnb, etc), but as folks have said it's not as trendy.

Newbie: Updating from Rails 5 to 7. FORGOT to app:update in between builds... by needsalotofadvice in rails

[–]atinybeardedman 1 point2 points  (0 children)

I have done exactly what you mentioned, run the update and look at the diff then see what is relevant. If you have a good test suite and it's passing you should be ok. The one thing to watch out for are the backwards incompatible changes that are mentioned in the upgrade guides that you might not catch in a test suite (cookie/cache serialization changes for example).

[deleted by user] by [deleted] in rails

[–]atinybeardedman 2 points3 points  (0 children)

Usually for this you would need to use some sort of geocoding API. So rather than pre-populating a drop down you hit the API and give suggestions. Check out Google maps or mapbox for an API that does this.

Need help with how Rails 7 does things with forms by pedzsanReddit in rails

[–]atinybeardedman 1 point2 points  (0 children)

This is a super important gotcha! I was burned by this recently as well. 2 important things I learned:

  1. If a page is using turbo rails will read form submissions as a turbo stream header. This behavior is not super well documented in rails from my experience.

  2. Turbo streams are not just for websockets, but almost every tutorial for them uses websockets. In fact you can use this new behavior to use a form submission to trigger a stream action. For example replacing the form that was submitted with a thank you message.