A JavaScript error in an E2E test with Selenium will not cause your test to fail. This may cause you to miss errors in your frontend code. Using the BrowserConsole...
!!driver_logs_proc end def driver_logs_proc browser = page.driver.browser if browser.respond_to?(:logs) # selenium-webdriver >= 4 proc { browser.logs } elsif browser.respond_to?(:manage) && browser.manage.respond_to?(:logs) # selenium-webdriver...
There are two ways a logout in SAML can happen: Service Provider (SP) initiated and Identity Provider (IDP) initiated logout. I'll explain how to implement both flows with devise...
...on logout and devise does not do that we get a Unsafe redirect to "https://some-idp.example.com/realms/dev/protocol/saml?SAMLRequest=fZJBb9QwEIX%2FSm45zcZx4j...", pass allow_other_host: true to redirect anyway. upon trying to logout.
Important Work on this lesson in advisor mode. Learning goals You can explain how server-side validation of single fields works while the user is still filling out the...
...an explanation for anything here, tailored to what you already know. Just ask. π Validating forms β server-side validation of single fields while the user types π Switching form state β showing and...
...in C, with much better performance (20-200x) than the version in the standard library, while being almost completely compatible...
Reads Active Record's validations and makes them available to live client side javascript
...that pops up as itβs a thing of beauty in a piece of software that usually is seen as highly unimportant, yet is the first thing you encounter when...
...taking commercial software for a spin...
...fans of progress, of technology's inexorable march forward, will change their tune as soon as progress destroys something they care deeply about...
...Adobe a few days before the launch of their flagship product, what hope do smaller players hold...
Here is how to use Chromedriver without libraries like selenium-webdriver. This can be useful for debugging. The following example visits a web page and reads the a headline's...
...things you can do with it, but performing more advanced tasks without a tool like selenium-webdriver can be quite difficult. However, for simple debugging or remote-controlling, curl might...
PostgreSQL can cosplay as a full-text search engine. It doesn't have the features or fidelity of ElasticSearch or Algolia, but it's good enough if you just need...
...to search and rank large volumes of text. This card will teach you how to index, search and rank your Rails models in a PostgreSQL full-text index. We will...
You can hook into Slack when using Capistrano for deployment. The slackistrano gem does most of the heavy lifting for you. Its default messages are unobtrusive and can be adjusted...
When deploying, it posts to a Slack channel like this: How to integrate Integrating Slackistrano with Capistrano 3 is fairly simple. If you are not a Slack admin
...uses a "real" time zone or :local, and if config.active_record.time_zone_aware_attributes is set to false or not. With time zones configured, always use .current for Time, Date, and...
...which hold time zone information and Time.now only in those that run with the server's time. If you don't, bad things can and will happen. More information can...
...table, two things happen: Rails tries to load all involved records in a huge single query spanning multiple database tables. The preloaded association list is filtered by the where condition...
...you only wanted to use the where condition to filter the containing model. The second case's behavior is mostly unexpected, because pre-loaded associations usually don't care about...
By default, the mouse pointer is at location (0,0) in a Playwright suite. For newly added elements that cover (0,0), hovering events (like mouseenter) did not trigger...
This happens only when the mouse pointer was never moved and seems to be caused by the Chromium feature RenderDocument which Playwright disabled before 1.62.
This is somewhat similar to the touch command of Linux: FileUtils.touch 'example.txt', :mtime => Time.now - 2.hours If you omit the :mtime the modification timestamp will be set to the current time...
...is a cron replacement. It runs as a lightweight, long-running Ruby process which sits alongside your web processes (Mongrel/Thin) and your worker processes (DJ/Resque/Minion/Stalker) to schedule recurring work at...
...particular times or dates. For example, refreshing feeds on an hourly basis, or send reminder emails on a nightly basis, or generating invoices once a month on the 1st...
Download buttons can be difficult to test, especially with Selenium. Depending on browser, user settings and response headers, one of three things can happen: The browser shows a "Save as...
...dialog. Since it is a modal dialog, we can no longer communicate with the browser through Selenium. The browser automatically downloads the file without prompting the user. For the test...
cpulimit is a simple program which attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time). This is useful to control batch jobs, when...
...eat too much cpu. It does not act on the nice value or other scheduling priority stuff, but on the real cpu usage. Also, it is able to adapt itself...
...Object into Integer (TypeError) Integer(2) # 2 Integer("11", 2) # 3 This is very similar but not identical to to_i: "2".to_i # 2 "foo".to_i # 0
...an instance of Object (NoMethodError) 2.to_i # 2 "11".to_i(2) # 3 Integer() supports a exception: false variant, which is very handy to cast user input without any exception...
The nokogiri gem provides different packages for several platforms. Each platform-specific variant ships pre-built binaries of libxml2, e.g. x86_64-linux includes binaries for 64bit Linux on Intel/AMD...
...This significantly speeds up installation of the gem, as Nokogiri no longer needs to compile libxml2. However, this also means that for each security issue with libxml2, Nokogiri maintainers have...
Understanding your type of cronjob Some cronjobs must only run on a single server. E.g. when you run nightly batch operations on the database, it should probably run on a...
...single server. Running it on multiple servers would likely result in deadlocks or corrupt data. Some cronjobs must always run on all servers. E.g. starting a sidekiq process on reboot...
Flash movies (.swf files) can talk with Javascript code embedded in the same HTML page. There are two ways to do this: The preferred way is to use the ExternalInterface...
...ActionScript by calling SetVariable(name, value) on the Flash movie's DOM element. This is super-legacy, but still encountered in the field. Note that communication between a Flash movie...
This note is a reminder that there is something called AppArmor that could cause weird errors ("File not found", "Can't open file or directory", ...) after configuration changes, e.g. when...
...and autoload paths. They do NOT create a module for namespacing. This is intuitive, since there normally is no module Model, or module Controller. If you want to add a...
βββ models βββ uploaders # No config needed βββ util # No config needed βββ workers # No config needed Sometimes it's handy to group files within a directory, but not reflect that grouping within...