I've been very interested lately in how I can use AI to take care of tasks for me. Here is one use case we've found that has been successful so far. New post over on the PlanetScale blog. Read here: Automating our changelog with Cursor commands
If you're finding AstroVim is lagging on very large files, it is possible the source of the problem is vim-illuminate . To determine if it is, run :TSDisable illuminate . Does it solve your problem? Large file cutoff If that solved your problem, you can disable illuminate for large
This took me a while to figure out. In this file: ~/.config/nvim/lua/community.lua You need to add the following line. { import = "astrocommunity.completion.copilot-lua-cmp" }, Then, when you start nvim again. Run :Copilot auth . This will trigger the setup and you'll be
I recently wrote a post over on the PlanetScale blog sharing how we make schema changes for our own Rails app. In the post I share a couple concepts that might be new to you. "Online" schema change tools Separating rails db:migrate from deploys If your team
High traffic websites often use database replicas to scale out their reads. Most web traffic is a GET request anyway and never modifies data. But how do you know when you should READ from the primary? The answer is more complex than you might think. And it's important
This took me too long to figure out. I hope this helps you if you are googling around. To force the GitHub Slack app to stop @ mentioning you. The only way I found is to do the following. In a separate slack workspace (that you don't care about/
I recently had the chance to work on building webhooks for PlanetScale. As part of this, I learned quite a lot about the possible security vulnerabilities that running a webhooks service can expose you too. You might be surprised with all the risks there are! Everything I learned is over
Here's an easy trick I reach for when wanting to add simple rate limiting to an endpoint. def special_endpoint model = Model.find(params[:id]) cache_key = "rate_limit:mymodel:#{model.id}" # If the key exists, we rate limit if Rails.cache.fetch(cache_key) return
I feel inspired to talk more about “testing a private method” (gasp!). Since people seem to get upset about it . Where did this idea of it being bad even come from? I remember when learning to code it was all over the place. Blog posts, books, podcasts. I
If you are debugging this Flash message error. undefined local variable or method `flash' for And you are currently using an API only Rails controller, but still want to use flash messages in your app because you are redirecting to a normal controller. Then you can fix this by
Recently I was working on a Rails API and I wanted to stop Rails from setting it's _session cookie for API requests. Since these requests are authenticated via an API token, there's no reason for the cookie to be returned to the user. # application_controller.rb
Fly has a graphql API available. You can find ways to use it by looking through their CLI's source code . I recently wanted to automate a Fly API call from a ruby script. And I was not in an environment where I wanted to install the fly CLI.
Here's a Ruby example of how to set a GitHub Actions secret using Octokit in Ruby. The secret needs to be encrypted before it is sent to the API. You need the octokit and rbnacl gems installed. require "octokit" require "rbnacl" client = Octokit::Client.
New post over on the PlanetScale blog . This was the toughest N+1 performance problem I've faced. It shows a trick you can use to preload records, in a situation where includes doesn't cut it. Go check it out .
If you're in a tech lead role and struggling. Try this. Make a mindset shift. Ask yourself: "How can I not be the person who builds that?" This will feel hard because for years you have been good at building. You're used to taking