...we have to keep a long list of all the methods and update it whenever changes are made? Fortunately not, because there is a common pattern for this in Ruby...
In whenever you can schedule Ruby code directly like so: every 1.day, :at => '4:30 am' do runner "MyModel.task_to_run_at_four_thirty_in_the_morning" end
...you can test, this is probably preferable to defining additional Rake tasks. Unfortunately when whenever register a runner command, it doesn't use bundle exec in the resulting crontab. This...
...Float, it is very easy for Float values to creep back into your code. Whenever you mix Floats with BigDecimals, the result will be a Float. A common mistake is...
...slow SQL queries, it’s helpful to understand the database engine's query plan. Whenever you execute a declarative SQL query, the database generates a "query plan" that outlines the...
...pageview', { 'page': '/YOUR-CUSTOM-PATH' }); With Unpoly With Unpoly you want to trigger an Analytics pageview whenever a major content fragment is replaced. See Unpoly instructions here. Legacy snippet Change this:
...may conflict with that. Here are two solutions that allow you to keep pushing whenever you feel like it. Special commit message To skip a CI run, simply add [ci...
...are actually handled. This card explains some of the interactions between them. In general, whenever an exception is raised in your app you want the following things to be true...
...if (p3 !== null) { printPoint(p3); // TypeScript narrows the type to Point2D inside the block } Whenever you apply a check on a specific type, the compiler knows that from there on...
...enable font smoothing for variable fonts. The bast workaround is to enable font smoothing whenever you apply the "wght" font variation setting. For example, to style the element: strong
...share a state in Ruby with global variables. Even if you should avoid them whenever possible, for debugging an application this could be temporary quite handy. Example: class User
...not implement sending a welcome e-mail, send an e-mail now. In MovieDB, whenever someone creates a movie, send a notification to moviedb-admin@example.com. Can you attach the movie's...
...with a throttling mechanism. Touch events can still be cancelled, mark them as passive whenever you can! Browsers will make some listeners passive by default From MDN: The specification for...
...but you need to call regularly from your preferred scheduler. For example, when using whenever, you should have something like this in your schedule.rb: every :day, at: '05:00', roles...
You can set up notification hooks to trigger a Desktop notification (or similar) whenever the Claude Code agent halts. Clicking the notification will open your configured IDE in the...
Whenever you create a table from a database migration, remember to add updated_at and created_at timestamps to that table. Without those timestamps, investigating future bug reports will be...
...the Module class. This method can be overwritten for module instances and is called whenever the module is included somewhere: module Greet def self.included(base) puts "Greet is included into...
...scripts (I use ~/bin/update-chromedriver) and give execute permissions (e.g. via chmod +x ~/bin/update-chromedriver). Then, whenever your Chrome is updated, run update-chromedriver and after one second you are ready to...
...care about the (longer) value and just stores the date part. This means that whenever you pass a time that is within X hours away from midnight (where X is...
...names on localhost. This is annoying, since you will sign out your current user whenever you switch to another app. A better way is to use our own daho.im service...
Whenever you have to deal with randomness in a jasmine test there are some spy strategies to help you out! Let's say we have a method Random.shuffle(array) to...
Background Ubuntu always sets the primary display to the 1st (i.e. internal) display whenever I connect to a new Dock/Hub. I want my primary display to be the large...
...you use the selenium-webdriver gem, it will sneakily phone home once every hour whenever you run a browser based feature spec. Check if you're affected Check if ~/.cache/selenium/se-metadata.json...
...of the groups development and test when deploying to the stages production and staging. Whenever you create custom groups in your Gemfile, make sure to exclude these, if they should...
SVG is an acronym for "scalable vector graphics". SVGs should be used whenever an image can be described with vector instructions like "draw a line there" or "fill that space...