# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
Most instructions for using Capistrano tell you how to make it restart Phusion Passenger by 'touch'ing the restart.txt
file, but this doesn't immediately restart the app - instead the first person to try to use the application will cause it to be restarted, so they will see a delay of at least a few seconds.
This shows how to add a post-deploy task to 'ping' the server, to cause it to restart immediately.
Then add a deploy:ping
task to config/deploy.rb
and set it to run automatically after deploy:restart
. Alternatively you could put it into the deploy:restart
task directly.
TODO: Test the response HTTP header of the ping, that it is a 200, and not some other error response (404/500).
Finally, Simple Form support Boostrap 3. 👏
But I found it still dosen't support some components in Bootstrap 3. Or may be in the future. But I can't wait, so I find a solution to support them. It was inspired by heartcombo/simple_form#531 (comment) .
This is a final solution and I used in my project.
I use Bash’s PROMPT_COMMAND variable:
The value of the variable PROMPT_COMMAND is examined just before Bash prints each primary prompt. If PROMPT_COMMAND is set and has a non-null value, then the value is executed just as if it had been typed on the command line.
The source code should be pretty straight forward, but if not, please ask in the comments. Put this in your .bashrc or similar:
# per-directory Bash history
class QueueSizeMetricWorker | |
include Sidekiq::Worker | |
include Sidetiq::Schedulable | |
recurrence { minutely } | |
sidekiq_options retry: false | |
# Publish a custom metric on CloudWatch with the Sidekiq queue size | |
def perform | |
cloudwatch = Aws::CloudWatch::Client.new( |
UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).
If you are getting the error: No space left on device
Configuring the qcow2 size cap is possible in the current versions:
# my disk is currently 64GiB
{ | |
"atomic_save": true, | |
"caret_style": "phase", | |
"color_scheme": "Packages/ayu/ayu-mirage.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"folder_exclude_patterns": | |
[ | |
"coverage", | |
"tmp", | |
".git", |
{ | |
"bootstrapped": true, | |
"in_process_packages": | |
[ | |
], | |
"installed_packages": | |
[ | |
"A File Icon", | |
"Alignment", | |
"ayu", |
const _ = require('lodash'); | |
module.exports = ({e, addUtilities, config}) => { | |
const gradients = config('gradients', []) | |
const variants = config('modules.gradients') | |
const gradientUtilities = _.map(gradients, (colors, name) => { | |
if (!_.isArray(colors)) { | |
colors = ['transparent', colors]; | |
} |