...access and manipulate the browser's DOM tree. Using JavaScript we can add interactive behavior to our interfaces that would not be possible through declarative rules in HTML and CSS...
ActiveSupport (since 4.1) includes test helpers to manipulate time, just like the Timecop gem: To freeze the current time, use...
...when the model has no database or database columns yet. Example: class Post < ApplicationRecord begin # Magically auto-strips all string attributes columns.each do |column| next if [:string, :text].exclude?(column.type...
Any form fields where users enter numbers should be an . Numeric inputs have several benefits over : On mobile or tablet devices, number fields show a special virtual keyboard that shows...
When deleting a record in your Rails app, Carrierwave automatically takes care of removing all associated files. However, the file...
The value of the Unicode byte-order character placed at the beginning of the file (BOM). The value given by the charset attribute of the Content-Type...
PostgreSQL's Common Table Expressions (CTEs) can be used to extract sub-queries from bulky SQL statements into a temporary...
...in an encrypted YAML file. Usage is simple: each key in the credentials file becomes a method on Rails.application.credentials, returning the corresponding secret. # Credentials file file_storage_secret: superstrongsecret
...to determine if a service can be restarted or not. To manipulate the default behaviour, the package policy-rcd-declarative-allow-all or policy-rcd-declarative-deny-all can be...
> {% client.global.set("auth_token", response.body.token); %} ### //Accessing a variable GET https://example.com/api Authorization: Bearer {{auth_token}} Complete documentation can be found here: https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html
available for button, fieldset, input, select, textarea, command, keygen, optgroup, option Browser specific behavior: IE 11: text inputs that are descendants of a disabled fieldset appear disabled but the...
Your development server is usually running on an insecure HTTP connection which is perfectly fine for development.
CarrierWave comes with a set of default configuration options which make sense in most cases. However, you should review these...
...built into RSpec. Play with some of these matchers in your MovieDB tests. The benefits of using better matchers Which of the following two lines is better? Why?
...is often to prefer isolated tests where possible, but share test setup when it becomes excessively complicated or expensive. If we share setup, it is best to do within a...
...will be short a window manager. This might be fixable, but it's probably best to simply log out (or shut down) using the Gnome panel...
This card tries to summarize by example the different uses of heredoc. In Ruby << vs. <<- vs. <<~ In Rails strip_heredoc...
...a feature look and feel). Frequent deploy gets changes to users faster. We sleep better, because we know stuff still works. Make sure no one removes a feature by accident...
...application changes. The more tests you already have, the less useful an additional test becomes ("Diminishing returns"). Tests sometimes fail even though the code is fine, especially when the test...
Rails default config uses the ActiveSupport::Cache::NullStore and disables controller caching for all environments except production: config.action_controller.perform_caching = false...
In a JavaScript console, type this: > 9112347935156469760 9112347935156470000 Ooops. And that's not a float! This occurs because JavaScript uses...
...gitignore, see https://makandracards.com/makandra/15947 [diff] algorithm = patience # A slower algorithm that sometimes produces better diffs [fetch] prune = true # Remove local remote-tracking branches that have been deleted [rebase]
main-view = date:relative author:abbreviated commit-title:graph=true,refs:true A better diff tool You may switch to delta, a fancy diff tool with syntax highlighting and...
jQuery doesn't store information about event listeners and data values with the element itself. This information is instead stored...
Ever needed to migrate data between Redis instances? Give RIOT - Redis Input/Output Tools a try. It supports migration to different...
A recent patch level Ruby update caused troubles to some of us as applications started to complain about incompatible gem...
In a nutshell: Use git rebase --onto target-branch source-commit target-branch means "branch you want to be based...