Stackprof VS Rbspy
I’ve been learning a bit about Ruby profilers lately, in particular rbspy & stackprof. These profilers allow you to see what your code is doing over a given interval of time.
Software Engineer from Dublin
I’ve been learning a bit about Ruby profilers lately, in particular rbspy & stackprof. These profilers allow you to see what your code is doing over a given interval of time.
We can also run into n + 1 queries when dealing with GraphQL in Rails. The standard pattern for solving N + 1 in GraphQL is with loaders.
N + 1 query optimisation in Rails is a classic ORM optimisation problem. Knowing the standard patterns for solving N + 1 queries in Rails should be a prerequisite for anyone wanting to be considered a senior rails developer.
What’s the difference between these two lines of Ruby code:
I’ve been reading Martin Kleppmann’s book “Designing Data-Intensive Applications” and decided to create a simple project to explore and solidify my understanding of some of the concepts explained in his book. The code for this post can be found here.
I’ve decided to redesign this site as a way of learning CSS grid. I’m going to code as I put this blog post together.
I’ve always found testing CSVs with RSpec to be pretty painful. Generally, CSVs are tested like this:
Recently in work we’ve started using Percy.io to catch visual regressions in our UI. It’s a great tool - it allows us to catch regressions in CSS or HTML that we would have only caught previously with manual testing.
One common task that Rails developers use day to day is rake routes
(or rails routes
in Rails 5). As your app grows, you’ll use grep
to only show the routes you’re interested in:
There are some Rails issues that may require me to run a server locally with the production environment to debug. An example of such an issue might be a missing asset. Running the server in the production environment isn’t difficult, although there are a couple of non obvious steps.
Quite often I’ll need to get a count grouped by multiple columns but the output is confusing:
In ruby you can assign to multiple variables like so:
Say you have an index action renders a collection of posts. Your posts also have different kinds that have special conditions to render as a collection and you’ve created scopes to handle this.