This card needs to be updated for Rails 3+. Since there is no --debugger flag you need to run:
...database (ActiveRecord) What is a model? How are records retrieved and saved? Validations Migrations belongs_to, has_many, has_many :through Gain an understanding of the structure of a basic...
...in the database. Don't get confused by the use of text_field below. Beautiful controller pattern Refactor your MovieDB controllers to the pattern of our default controller implementation (without...
When working with feature branches, stale branches pile up over time. It's best to remove them right after merge, locally and on the remote, but it is a little...
if [[ "$merged_branch_name" =~ ^(master|main|production|Fast-forward)$ ]]; then exit 0 fi # Begin output echo " " echo "> You have just merged the branch \"$merged_branch_name\" into \"$branch_name...
...ms have passed!') }, function(reason) { console.error('Something went wrong: %o', reason) } ) This will become more important when we talk about async/await later. Exceptions are converted within then() handlers function fetchUsers...
} If f1() and f2() have an async API, our control flow must become async: function f1() { return Promise.resolve(2) } function f2(x) { return Promise.resolve(x * x) }
...instead of downloading and bundling font files yourself. (See below for a list of benefits.) Usage Go to fontsource.org and search for the font you want to add (or a...
...s Fontsource details page for available settings. Why? Using an NPM package has some benefits over placing fonts into your repo: All font weights and glyphs are included.
...notification service: Use @Input() id: number with component input binding; Update notification.service.ts: Define notification$: BehaviorSubject: Store the last fetched notification; Update notification$ when a new notification is fetched; Using Efficient...
...keywords in your prompts. LLMs excel at pattern recognition, and specific terminology reduces ambiguity. Beyond that giving examples for high level APIs of your imagened class design or using an...
TL;DR When using Cache-Control on a Rails application, make sure the Vary: Accept header is set.
Ubuntu might create several keyrings for you. Note that keyring passwords are initially set to the user password but do...
...users". The red area corresponds to the records in the resulting scope. # NAND: Default behavior for Hash with multiple attributes # Excludes only users who are BOTH admins AND trashed. User.where.not...
...points to an Array of values, Rails applies standard SQL NOT IN logic. This behaves effectively as a NOR condition relative to the values in the array (neither A nor...
In case you have sensitive data within your RDS instance, you want to use encrypted connections between your application and...
Event listeners are called in the order of their registration: button.addEventListener('click', () => console.log("I run first")) button.addEventListener('click', () => console.log("I...
...as the video is free for end users." (MDN) H.265 / HEVC see H.264 (successor, better compression as H.264) VP8 royalty free VP9 royalty free (sucessor, better bit rate as VP8...
royalty free (planned successor of VP9 with better compression rates) Further reading: MDN: Web video codec guide Audio Codec Format Matrix A broader comparison of many audio codecs can...
Expecting a primitive value as an argument to a method invocation is easy: expect(object).to receive(:foo).with('arg1...
...ms long. Once a frame renders longer than 16ms, the page will begin to feel staggering and slow. Google Chrome DevTools The Chrome DevTools enable you to precisely investigate and...
...complex. Deeply nested rules and slow selectors are the main cost factors. Using a BEM pattern for CSS should produce relatively fast CSS. Performance issue 4: Slow repaints
...However, users with limited bandwidth (i.e. on mobile) need to mine their data budget better. One popular strategy to improve the website performance is to not load images until they...
...via jQuery, as it does not support capturing events. JS-only: not working The "best" strategy would be to hide the src attribute of image tags from the browser with...
You can change the color for text selection via CSS, using the ::selection and ::-moz-selection pseudo-elements.
...the number and last point in time when autovacuum and autoanalyze happened for tables belonging to the currently connected database. SELECT relation::regclass, * FROM pg_locks WHERE not granted;
Open up your "Base File.sublime-settings" (Preferences Menu → File Settings – User) in Sublime Text 2. Add entries for font_face...
When you want to quickly boot from a drive or image in a virtual machine you do not need to...
If you need to log to a file you can use Ruby's Logger class: require 'logger'
When testing JavaScript functionality in Selenium (E2E), you may need to access a class or function inside of a evaluate...
...I am really pleased with it -- but only on a desktop computer. Have you benchmarked the framework also on smartphones and tablets? Unfortunately I must say, that it does not...
...as a jQuery collection: let $element = $(element) An API object to call additional JavaScript behavior added by a library: var player = flowplayer($element) player.play() Framework activation layers (like Angular directives...
React.js is a relatively new Javascript templating engine that has two-way-bindings like AngularJS or Batman. The interesting idea...
Your current ruby must be Ruby Enterprise. gem install passenger passenger-install-apache2-module Edit your httpd.conf according to the...