...in your stylesheets. Usually this should not be a problem, but at times they include misleading Meta-information that leads to a strange error in the PDF. The setup

...need to parse the given string of Ruby code. You don't need to include methods from the superclass. You may assume that the given code contains exactly one class...

makandra dev
rails-sqli.org

...methods can open up code to SQL Injection exploits. The examples here do not include SQL injection from known CVEs and are not vulnerabilites themselves, only potential misuses of the...

...excludes spaces, control characters, and similar) /[[:lower:]]/ Lowercase alphabetical character /[[:print:]]/ Like [[:graph:]], but includes the space character /[[:punct:]]/ Punctuation character /[[:space:]]/ Whitespace character ([[:blank:]], newline, carriage return, etc.)

makandra dev

Rails 6 includes a WYSIWYG editor, Action Text. It works out of the box quite well, but chances are that you want to add some custom functionality. This card contains...

...TypeScript, and modern browsers will run them natively. Features supported by all modern browsers include: fat arrow functions (() => { expr }) let / const class async / await Promises Generators Symbols Rest arguments (...args...

This card shows an uncommon way to retrieve a file using selenium where JavaScript is used to return a binary...

I recently noticed a new kind of flaky tests on the slow free tier GitHub Action runners: Integration tests were...

evilmartians.com

...suite of tools designed to improve the performance of Ruby test suites. Key tools include: EventProf: Measures the time spent on specific events during tests to identify slow processes.

Rails default config uses the ActiveSupport::Cache::NullStore and disables controller caching for all environments except production: config.action_controller.perform_caching = false...

Learn to create test data effectively using factories. Decouple tests by having each test start with an empty database...

There is no single place to look up documentation for our stack. This card includes some hints where you can find API documentation. You probably want to drag a few...

...even if it spans over multiple elements in the HTML. Imagine a page that includes this HTML: Hi! Try to match me. Even though the text is separated by a...

makandra dev

There is no does method anymore We now use traits with the vanilla include method: class Article < ActiveRecord::Base include DoesTrashable end When your trait has parameters, use square...

class Article < ActiveRecord::Base include DoesStripFields[:name, :brand] end Note how you can now follow trait names by CTRL+clicking on them in RubyMine! New naming convention for traits...

...trait for validating the extensions and content types in all of your uploaders (by including it on the base uploader) and that it now looks like this: class BaseUploader

...in this trait, these lines should now be removed. class BaseUploader < CarrierWave::Uploader::Base include DoesStrictTypeValidations # ... end Now, in your uploaders... def extension_white_list %w[jpg jpeg gif png...

For Selenium tests, your browser starts in your local timezone, or whatever your system's environment specifies. This is usually...

If you need to make an HTTPS connection to a host which uses an expired certificate, do not disable certificate...

regular-expressions.info

...w matches a word character (alphanumeric characters plus underscore) \s matches white space character (includes tabs and line breaks) \t matches tab character Non-Printable Characters \xFF matches hexadecimal character...

...hook will run after all scenarios have been executed. AfterAll do ... end You can include code to Cucumber in the World module without polluting the application namespace (example from...

...combining international and local numbers, see example below) as the called number should not include that zero. def tel_to(text) groups = text.to_s.scan(/(?:^\+)?\d+/) if groups.size > 1 && groups...

...yet their concrete internal implementation and API differs in certain aspects. The last chapter includes a framework comparison table on the main APIs learnt throughout the book...

...times, you won't see a problem with Browsers like Chrome, simply because they include some well-known intermediate certificates (like those of Comodo). >> RestClient.get('https://incomplete-chain.badssl.com/') RestClient::SSLCertificateNotVerified...

...your certificate store. Note that it is essential to call set_default_paths to include your system's default certificate store which contains root CAs. You may omit this but...

...card Accessibility: Making non-standard elements interactive for more details of this approach. It includes various implementation variants depending on the given technology stack and use case. See also

...not add puppet parameters to nagios config next if ['tag', 'ensure', 'require', 'target', 'mode'].include?(parameter) -%> <%= parameter.ljust(35,' ') %><%= value %> <%- end -%> } <% end %> Conclusion Since there is only one file the overhead...