...first get a general overview of the most popular solutions. To chose a single "best" of those, ask yourself questions such as: Is the library still maintained? When was the...

...level of our own standards. Does it have a ton of dependencies? Fewer is better, in this case. Sites like the Ruby Toolbox (only for gems) or npm compare may...

Imagine the following HTML structure, where the scrolling container has overflow-y: scroll: +--scrolling container+-+ | | | +-child element+----+ | | | ++iframe++ | | | | | | | | | | | | | | +-----------------------+ | | | | <-- actually cut...

ignore_rules << (pattern || block) end def mute(&block) @muted = true if block begin block.call ensure unmute end end end def unmute @muted = false end def self.current @current ||= new...

If you want to perform a failover on another haproxy backend server this is the way you should do it...

...may feel odd that the SQL statement says "UPDATE new_table". If your migration becomes too complex, you could put your logic into multiple reversible blocks (so they contain only...

end end A word of advice: Depending on your migration, you might be better off just defining 2 separate up and down methods instead of using change...

When you open up a story to only have a look at it, close it by pressing the "Cancel" button...

If a controller action responds to other formats than HTML (XML, PDF, Excel, JSON, ...), you can reach that code in...

...your Firefox versions because your Selenium tests break whenever Firefox updates, there is a better way that lets you keep an up-to-date Firefox. Mozilla has stated that they...

...data is guaranteed. There are however cases where you want to improve the user behavior (Rails error box) or reduce the number of exceptions e-mailed to your / collected by...

...values, which map to one context, e. g. mail components, in order to provide better readability of your tests or to even make clear a tests fail reason due to...

So you have a heading that is just barely wider than the container it should fit into, and it wraps...

makandra dev

This is about converting Haml to ERB and not the other way round which you probably want! This process can...

Debugging performance issues in your Rails app can be a tough challenge. To get more detailed insights consider using the...

...with the desired metric from Ollama's response: # app/util/ollama.rb ActiveSupport::Notifications.instrument('request.ollama') do |payload| begin response = HTTP.post('https://my-ollama-instance.com/api/chat', json: body) if response.status.success? parsed = response.parse payload[:input_tokens] = parsed...

If you're still working on ruby 1.8, you should know that using SimpleDelegator is often prohibitively slow. I have...

Consul 0.6.1+ gives your Power class a number of static methods that behave neutrally in case Power.current is nil. This allows you to create authorization-aware models that still work...

...user.email, user.income] end end end There is a long selection of class methods that behave neutrally in case Power.current is nil: Call Equivalent Power.for_model(Note) Power.current.present? ? Power.current.notes : Note

...can be useful to model a period without an actual end or an actual beginning. Imagine someone taking holidays and booking a holiday without knowing the end yet. Or providing...

web.archive.org

This note shows how to merge an ugly feature branch with multiple dirty WIP commits back into the master as...

relishapp.com

Sometimes you have a test expectation but actually want a better error message in case of a failure. Here is how to do that. Background Consider this test: expect(User.last...

Why is this cool? One might argue why we would want to have better error messages for test expectations when our tests are supposed to be always passing. Well...

How can I configure virtual IP's? There are two parameter to set up virtual ips in Keepalived: virtual_ipaddress...

Cards can now be flagged as "Repeating". Every Wednesday, some of these cards will be moved back to the top...

You may remember to use the || operator with caution to set defaults. We'll see that && and other conditionals come...

alanklement.blogspot.de

...written about the problem with user stories before. At the time, I found it better to just have the team talk over proposed changes to the product. This worked great...

...scope like Post.active and use that. Learn Resources Active Record Query Interface Rails Database Best Practices ActiveRecord: Specifying conditions on an associated table Preload, Eagerload, Includes and Joins

...multiple but simple queries. This can be easier to understand and may even perform better. Exercises Cards query (makandra only) Ask someone for a dump of the staging target and...