web.archive.org

...any cleanup yourself. Why? Understand this: before(:context) is run when the context/describe block begins, before(:context) is run outside of transactions, so data created here will bleed into other...

makandra dev

This talk shows simple and advanced usages of the ruby/debug debugger. It goes through a step by step debugging workflow...

When your Cucumber feature needs to browse the page HTML, and you are not sure how to express your query...

...lockfile carefully when submitting a commit. Note that the approach in this card works best, if you use yarn outdated or npm outdated together with yarn upgrade some_package or...

...more information about this issue. In Rails3+ you can also disable this annoyingly clever behavior. Why this is bad This has some develish implications for your deployment, because scopes written...

...t notice this during development. Let's say you have a model Note which belongs to an Author and has a string column category: class Note < ActiveRecord::Base

Rails is split into a large number of (sub-) frameworks. The most important and central of those are activesupport (extends...

github.com

When using Sidekiq in your application, you must write thread-safe code. This wiki page also lists gems that are...

...all routes, but may return early, a change has been introduced to add lazy behavior by adding an iterator block and yielding. This change breaks the adapter patch in routing...

...the window's resize event, that might call your event listener many times. A better way is to subscribe to changes of the MediaQueryList object that is returned by matchMedia...

I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...

github.com

...API design, I thought it might be nice to write down a set of best practices. And poke fun at a couple widely-used APIs. Much of this may be...

...also in our library): Designing a Complex Form Designing a Dashboard Designing Content Designing Beautiful Shadows in CSS Pairing typefaces Then, take the quiz at cantunsee.space. Did you spot all...

...system's environment specifies. This is usually good enough. To test any timezone-dependent behavior in Chrome, you can change the time zone using the Chrome DevTools Protocol. Example

Capybara and most assistive technology will fail to find tags that are missing an href attribute. This will probably happen...

...DateTime.strptime is not what you want You may eventually encounter DateTime.strptime. It's a "better" Time.parse where you can actually define the date format to parse, e.g. >> DateTime.strptime...

...If you use Rails' time_zone_select, you will be juggling zone names like "Berlin" which are actually unsupported. Unsupported zone identifiers are silently discarded and you'll end up...

Rails' default logger prefixes each log entry with timestamp and tags (like request ID). For multi-line entries, only the...

Software engineering principles Read about the following software engineering principles and code smells: Single Responsibility Principle Law of Demeter

makandra dev

...API (notable methods and properties) video = document.querySelector('video') video.play() video.pause() video.load() // Reset to the beginning and select the best available source video.currentSrc // The selected source video.currentTime // The current playback time...

caniuse.com

All major browsers (IE8+, FF3.5+, Safari 4+, any Chrome) support sessionStorage, a JavaScript storage object that survives page reloads and...

...component is using this class to render and modify some html, it may fastly become boilerplate to define every call of the method. Here callFake comes in handy, because it...

...of any dependent on the received arguments without having to know the exact arguments beforehand: spyOn(Random, 'shuffle').and.callFake((array) => array.reverse()) Now you can just assume any result of your...

en.wikipedia.org

Although you can access many symbols using the AltGr key you may be missing some, like the en-dash (–) or...

When using Rails to truncate strings, you may end up with strings that are still too long for their container...

So your Cucumber feature sometimes dies with this exception: Modal Dialog Present (Selenium::WebDriver::Error::UnhandledAlertError) As a seasoned Selenium...

No out of the box I18n support for translating the database values But: Better support for the enumerated database type and therefore better suited for performance optimizations