whenever: Preview the crontab
If you'd like to preview the crontab that whenever Show archive.org snapshot will deploy, run the following:
bundle exec whenever
This will print the cron syntax without modifying your local crontab.
Related cards:
Whenever requires you to set the application attribute in the Capistrano config
Whenever requires you to set the application
attribute in your Capistrano configuration. Otherwise your cronjobs are created multiple ti...
IE9 preview – Jeffrey Zeldman Presents The Daily Report
I’m pointing out the enforced bragging, which is mandated from on high, and which flies in the face of the humble stance other high-level divisions in Microsoft would like to enforce in the wake of the company’s European drubbing and the dents App...
Preview Github-flavored Markdown from the bash with ianks/octodown
Preview what your markdown would look like on Github. Helpful e.g. when writing or extending a Readme for your gem or projects.
Installation
sudo apt-get install cmake libicu-dev # required for building native extensions
gem install octod...
Cronjobs: "Craken" is dead, long live "Whenever"
Our old solution for cronjobs, the "craken" plugin, is no longer maintained and does not work on Rails 3.2+.
We will instead use the whenever gem.
"Whenever" works just like "craken", by putting your rake ta...
whenever: Installing cron jobs only for a given Rails environment or Capistrano stage
We use the whenever gem to automatically update the crontab of the servers we deploy to. By default, whenever will update all servers with a matching role ([we use the :cron
role ](https://makandracards.com/m...
Whenever: Don't forget leading zeros for hours!
Whenever is a Ruby gem that provides a nicer syntax for writing and deploying cron jobs.
Leading zeros are important for whenever if you use the 24-hours format!
This schedule.rb
:
every 1.day, at: '3:00', roles: [:primary_cron] do
r...
How to show an ordered crontab
Crontabs are often unordered, especially when generated for an application where you usually group tasks by their domain/scope.
An example crontab might look like this:
# Begin Whenever generated tasks for: project100
MAILTO="log@example.com...
Ruby constant lookup: The good, the bad and the ugly
In Ruby, classes and modules are called constants. This card explains how Ruby resolves the meaning of a constant.
The good
E. g. in the following example, Array
could mean either Foo::Array
or simply Array
:
class Fo...
whenever: Make runner commands use bundle exec
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
Combined with the best practice to hide backg...
Let the browser choose the protocol
Use protocol independent URLs whenever possible so that the browser will choose the protocol related to the protocol which the page is delivered with.
Example issues
- When your page is delivered via
https
and you provide a youtube video onl...