Shorthand function properties in ES6
ES6 object literals support concise method syntax and inline getters, replacing verbose function properties and Object.defineProperty() for simple computed values.
HTTP Client in RubyMine
RubyMine’s built-in HTTP client tests web APIs from .http scratch files, supports sequential requests, and can reuse response data with JavaScript variables.
Error handling in DOM event listeners
DOM event handler exceptions are swallowed, so later listeners and dispatchEvent() continue running. Uncaught errors still reach the browser log and window error event.
Ruby: Referencing global variables with the built-in English library
Ruby’s special global variables are harder to read and can fail without require 'English', especially in Rails where the library is not loaded by default.
Ruby / Rails: clone vs. dup vs. deep_dup
Copying Ruby objects can preserve or drop frozen state, singleton methods and mixins, while nested references stay shared unless a true deep copy is used.
Always disable autocomplete for date pickers
Browser autofill can cover date picker popups and make them unusable. Disabling autocomplete on the trigger input keeps the calendar visible while preserving fallback behavior.
ActiveRecord: Specifying conditions on an associated table
ActiveRecord queries can filter on columns from an associated table without raw SQL, using subqueries, ID plucking, traverse_association, or joins.
How to write modular code
Reduce spaghetti code by splitting behavior into focused functions, service classes, form models, and value objects, while avoiding long parameter lists and excessive DRY.
Checklist: Using Carrierwave in a Rails project
Checklist for CarrierWave edge cases beyond the default Rails setup: secure URLs, image resizing, metadata handling, file validation, and efficient processing.
Always convert and strip user-provided images to sRGB
User-uploaded images can lose correct colors if metadata is stripped before color conversion. Converting to sRGB and reattaching the profile keeps browser rendering consistent.
Defining new elements for your HTML document
Custom elements let you create semantic HTML components that browsers render normally and activate directly with customElements.define(), avoiding framework-specific compilation.
How to update the bundler version in a Gemfile.lock
Bundler versions in Gemfile.lock can lag behind the installed release and break compatibility with older Ruby or Rails setups. Updating bundler and regenerating the lockfile keeps BUNDLED WITH aligned.
Capybara: Execute asynchronous JavaScript
evaluate_async_script runs asynchronous JavaScript in Capybara and waits for completion, avoiding Selenium timeouts and allowing Ruby to receive results or error details.
Rails: Do not load frameworks you don't need
Loading every Rails framework increases startup time and memory use; disabling unused railties and gems keeps apps lighter and avoids unnecessary configuration.
Controlling how your website appears on social media feeds
Social network previews often pick the wrong title, image and description unless OpenGraph meta tags provide them; Facebook caches previews and may need manual refresh.
Ruby: How to use global variables for a conditional debugger
Global variables can temporarily gate a Ruby debugger, avoiding repeated stops in callbacks and specs when only one execution path matters.
Unpoly: Showing the better_errors page when Rails raises an error
AJAX errors in Unpoly can hide the full better_errors page in Rails development. A fallback full-page reload restores the interactive error view and CSS.
RubyMine: Efficiently filtering results in the "Finder" overlay
RubyMine Finder searches can return huge result sets; file masks, directory limits, regex, and other filters narrow matches and speed up locating the right code.
Jasmine: using async/await to write asynchronous specs
Readable Jasmine specs can use async/await for promises, async setup, event waiting, and controllable async spies instead of done callbacks.
Documenting your project's Node.js version in .nvmrc
Node.js compatibility depends on the exact runtime version, and projects can pin a supported release in .nvmrc so teams use the same setup.
Events triggered by jQuery cannot be observed by native event listeners
jQuery trigger() emits events that native addEventListener() handlers cannot observe, which breaks mixed jQuery and non-jQuery code. Native dispatchEvent() works for both worlds.
Webpack: How to split your bundles
Large JavaScript libraries can bloat the main bundle; import() lets webpack load them asynchronously and keep rarely used code out of the initial payload.
Capybara: Testing file downloads
File downloads are awkward to verify with Selenium because browsers may prompt, auto-save, or render binaries instead of HTML. Alternative approaches use request specs, Rack::Test, or the browser download folder.
SameSite cookies
Browser defaults are shifting toward SameSite=Lax, making cross-site cookie behavior stricter and exposing iframe, API, and non-GET request flows that need SameSite=None or Strict.