If your railscomplete-deployment uses the net-ssh-gem please ensure you use version 5.2.0 or newer to ensure you can deploy via Capistrano. It's best to use...
To completely remove the old host key on the client run: # remove host entry ssh-keygen -f "$HOME/.ssh/known_hosts" -R appserver.makandra.de # remove IP entry ssh-keygen -f "$HOME/.ssh/known_hosts" -R $(getent...
With gem dependency it is possible to check the dependencies for your gem before you install it.
...records of a Ruby on Rails ActiveRecord model to be organised as a tree structure (or hierarchy). It uses a single, intuitively formatted database column, using a variation on the...
...materialised path pattern. It exposes all the standard tree structure relations (ancestors, parent, root, children, siblings, descendants) and all of them can be fetched in a single sql query. Additional...
An unresponsive service can be worse than a down one. It can tie up your entire system if not handled properly. All network requests should have a timeout.
...You should avoid Ruby’s Timeout module. The default is no timeout, unless otherwise specified. Enjoy...
Ruby's standard library is in the process of being gemified. It will soon - Ruby 2.5 - consist of RubyGems, which can be updated independently from Ruby. This might mean smoother...
...Ruby upgrades in the future. If breaking API changes happen in standard gems, we can update these before upgrading Ruby...
The Bullet gem is designed to help you increase your application's performance by reducing the number of queries it...
The The U.S. Digital Services Playbook is pretty amazing (context...
...to the Polymer project's paper elements collection. Our goal is to provide a set of AngularJS-native UI elements that implement the material design system...
Holly Schinsky from Adobe shows some of Bootstrap's capabilities. The combination of explanation, screenshots and source code makes it easy to understand
...users will receive update notifications in April offered through the browser’s internal updating service that will update the version to the latest stable build of the browser...
...are automagically available through accessors on the Active Record object. When you need to specialize this behavior, you may override the default accessors (using the same name as the attribute...
...and simply call the original implementation with a modified value. Example: class Poet < ApplicationRecord def name=(value) super(value.strip) end end Note that you can also avoid the original setter...
So you want to know if you are on natty, precise, quantal, or something else? Check /etc/lsb-release. $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION...
...can view with crontab -l and edit with crontab -e. You'll need to su to the respective user to view or edit her crontab...
...You very likely have a model that has a delay attribute. You can configure Sidekiq to remove its delay method by adding this to your Sidekiq initializer: Sidekiq.remove_delay!
...you need to keep Sidekiqs delay features, add Sidekiq.hook_rails! before the option above. The sidekiq methods will be prefixed with sidekiq_ then...
Although regular expression syntax is 99% interchangeable between languages, keep this in mind: By default, the dot character (".") does not match a line feed (newline, line break, "\n") in any...
...use the /s modifier in Ruby. It changes the RegExp to interpret text as Shift JIS encoded which you probably don't want. Javascript There is no modifier to make...
...to do a VACUUM FULL without holding an exclusive lock during processing. There is still a need of one exclusive lock at the beginning and the end of the repacking...
...affected table. Warning pg_repack writes a copy of the whole table. The database server needs to have at least ($size_of_biggest_table * 2) + some buffer free disk space...
...you want to automatically delete old container images from your Elastic Container Registry, the solution is a quite simple ECR Lifecycle Rule that deletes images e.g. 7 days after they...
...is a floating tag always associated with the image currently deployed to production, the situation suddenly is not so simple any more. ECR does not provide a keep action in...
A common task in web applications is to add client-side JavaScript behavior to existing HTML elements. For instance, in Working with the DOM you built a movie counter...
...JavaScript for both lists? For this your JavaScript must be abstract enough to not contain screen-specific references (such as selectors or URLs). Note that it's OK for the...
...the code below to check whether the browser can make connections to the current site: await isOnline() // resolves to true or false The code The isOnline() function below checks if...
...you can make real requests by re-fetching your site's favicon. If the favicon cannot be downloaded within 6 seconds, it considers your connection to be offline. async function...
As developers we are dealing with many tasks every week. We need a system to organize ourselves. Goals After completing this card you should have: A to-do list that...
...never forget a task that a colleague or customer gives us. A habit of splitting any kind of task or project into actionable first steps. A habit of fully completing...
...implementation changes. The information below is validated for the current list of browsers we support. By default your html and body elements are only as high as the actual page...
...html and body elements will only be around 40 pixels high, regardless of the size of your browser window. You might be surprised by this, since setting a background on...
...s calc(100 - l)); Here is what happens: from currentColor tells hsl() to start with the value of currentColor. calc(h + 180) rotates the color hue by 180 degrees, i.e...
...to the opposite of the color wheel. s keeps saturation unchanged. calc(100 - l) inverts lightness. For example, 0% becomes 100%, and 100% becomes 0%. Example usage .demo { --inverted-color...
...lists and explains global Ruby "dollar" variables, such as: $: (load path) $* (ARGV) $? (Last exit status) $$ (PID) $~ (MatchData from last successful match) ...and many more you'll need when reading weird...
$1 $2 $3 $4 (match groups from the last pattern match) $& (last matched string) $+ (last match group) `$`` (the string before the last match) $' (the string after the last match...
...administrator before publication. Requirements Movies in MovieDB should have one of the following workflow states: draft pending published declined A movie always begins as a draft and then transitions through...
...as it's getting reviewed. This could be a typical state flow for a movie: stateDiagram-v2 [*] --> draft draft --> pending pending --> declined: Reason declined --> pending pending --> published Changes to the...