Do­nau­dampf­schiff­fahrt Caveat: Unexpected copy & paste behavior Note that when copying a text with soft hyphens, the soft hyphen character will be...
...applications with forms (warp_params will do that for you). But maybe its a better idea to stick to a standard that client libraries know to handle. Tests
...really nice and we implemented it in a similar way like here. In the beginning we tried to remove any duplicated in the schema files. So when a booking had...
...silenced.join('|')) ActiveSupport::Deprecation.behavior = lambda do |msg, stack| unless msg =~ silenced_expr ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:stderr].call(msg, stack) end end This will only work with warnings that go through...
If you stub a method or set expectations with should_receive these stubbed methods may also yield blocks. This is...
When working with custom transactions and use ActiveRecord::Rollback you may encounter unexpected behaviour if you try to roll back your changes. tl;dr When using nested transactions, ActiveRecord::Rollback...
...only roll back the inner, but not the outer transaction. You can fix this behavior by using transaction(joinable: false) but this leads to a bunch of different problems.
...to work, and SameSite=Lax (new Chrome default, gradually rolled out) is an even better default for cookies. Set SameSite=Strict only for extra security in special cases (see below...
...same site, from the page or from an iframe. This is how cookies have behaved the last decades. SameSite=Lax Only send the cookie in a first-party context (meaning...
When working with file uploads, we sometimes need to process intrinsic properties like the page count or page dimensions of...
t.string :title t.references :user t.timestamps end end end class Task < ApplicationRecord belongs_to :user validates :title, presence: true end class User < ApplicationRecord has_many :tasks accepts_nested...
for (let element of clone.querySelectorAll('[name]')) { element.name = element.name.replace(NESTED_NAME, uid) } template.insertAdjacentElement('beforebegin', anchor) anchor.appendChild(clone) } up.compiler('[nested-records]', function(container) { const template = container.querySelector('[nested-records--template]')
...application and your maintenance page's structure. We recommend you verify how the application behaves when the maintenance page is enabled while a user interacts. Manual steps
If you don't want to mess around with arcane incantations inside xorg.conf, you can use the graphical arandr tool...
...styles from the document. See Styling a Web Component for this case. Applying JavaScript behavior to new elements All client-side JavaScript frameworks comes with mechanisms to activate JavaScript behavior...
...a framework mechanism you may use customElements.define() to register your custom element's JavaScript behavior with the browser directly. A big advantage of using the browser's customElements.define() is that...
...argument. Also, the code after the yield in example is not executed! Probably, this behavior was designed to enable programmers writing their own iterators (like while or loop) as methods...
For my Gem Session project Holly I ran the Ironman of drag'n'drop implementations: Dragging in nested lists
# Capitalized expressions are intended to be replaced with YOUR values describe 'SERVICE', -> beforeEach -> module 'MODULE' module ($urlRouterProvider) -> # Prevent uiRouter's initialization, i.e. do not sync the current URL...
...what "memoize" in earlier rails versions did. There is a gem that reintroduces this behavior, but this is the essential implementation. Remember In the above example, some_expensive_calculation is...
...crash your script. Either use if record.save, or wrap the respective code like this: begin # If using transactions, nest them here
...record.save! ... rescue ActiveRecord::RecordInvalid # Handle error end
In a Jasmine spec you want to spy on a function that is imported by the code under test. This...
...instantly. CSS, JavaScript and the browser settings all have options to influence the scroll behavior. They all interact with each other and sometimes use the same words for different behavior...
Scrolling elements can use the scroll-behavior CSS property to express a preference between smooth and instant scrolling. Preferring instant scrolling CSS can prefer instant scrolling behavior: html {
If you want to prevent that two processes run some code at the same time you can use the gem...
Nowadays it is fairly easy to intercept and modify mails globally before they are sent. All you have to do...
...where_values_hash. This should be the least preferred option. Often times, you are better off using invert_where (if available), Arel or a subquery...
...persist into your configuration. Use /tui default to disable again. Fullscreen mode some actual benefits: Enhanced Scrolling Use the PageUp / PageDown keys or the mouse wheel to scroll through history...
Notes compare writes it's result to STDERR. A lower score is better, I'd test for a threshold like <= 5. There are different comparison metrics available
The author describes his little journey in hunting down a memory leak. Maybe his approach and tooling may one day...