When using Savon to connect a SOAP API, you may want to use Savon::SpecHelper to mock requests in your tests as described in their documentation. When sending a message...
...body, the savon mock object requires a message to be set, like this: savon.expects(:action_name).with(message: { user_id: 123 }).returns(' ') If you want to stub only the returned...
If you're trying to start a cloud-init based Ubuntu VM with KVM you will suffer long boot times and confusing output on the terminal. If you want to...
...to remove cloud-init. wait until the VM boots login echo 'datasource_list: [ None ]' | sudo -s tee /etc/cloud/cloud.cfg.d/90_dpkg.cfg sudo apt-get purge cloud-init sudo rm -rf /etc/cloud/; sudo rm...
...all for laying out your HTML emails. Email client HTML rendering is way more scattered than browser HTML. While you might have a pretty good understanding of what features and...
...patterns you can use to support all major browsers, I doubt anyone masters this craft for HTML email clients. The only way to ensure your email looks good (acceptable, at...
...relaying information to input variables it's happening via environment variables. Depending on the size of the content of the variable it might exceed your OS limits. This is independent...
A possible workaround is to use a generated file to load the input instead of the env variable, e.g. # WORKAROUND # the variable my_huge_input cannot be...
...require 'mathn' 2 / 3 => Rational(2,3) 2 / 3 * 3 => 2 While this might sometimes be quite neat, it's a nightmare if this gets required by some gem that...
...suddenly redefines integer division across your whole project. Known culprits are the otherwise excellent distribution and GetText gems (the later only when working with mo-files). To fix this, you...
The Interactive Advertising Bureau (IAB) is a European marketing association which has introduced a standard how advertising can be served to users in line with the General Data Protection Regulation...
...GDPR). This standard is called the TCF 2.0 (Transparency and Consent Framework). If you want to integrate any kind of advertising into a website, chances are the advertising network will...
...the kind of query). It may help to understand youtube's domain model before starting. It's best to just try out your requests in the browser to see what...
...key in order to make this request work): https://www.googleapis.com/youtube/v3/playlistItems?playlistId= &key= A&part=snippet&fields=nextPageToken,items(snippet(publishedAt,resourceId(videoId))) There are more examples and explanations in the...
The debugger gem does not seem to be properly working on Ruby 2. Use byebug instead! Byebug is a simple to use, feature rich debugger for Ruby 2. It uses...
...new TracePoint API for execution control and the new Debug Inspector API for call stack navigation, so it doesn't depend on internal core sources. It's developed as a...
When using jQueryUI's Sortable plugin (either directly or via Angular's ui.sortable), you might struggle testing your nice drag&drop GUI since Selenium webdriver does not support native dragging...
But jQueryUI uses jquery.simulate for their testing, so why shouldn't you? There is even an extension to it that makes testing drag & drop quite easy.
It's generally not trivial to change a datetime's seconds, minutes, etc in SQL. Here is how it works when speaking PostgreSQL. Consider you have a timestamp column whose...
...seconds you want to zero: SELECT born_at FROM users; born_at --------------------- 2015-05-01 13:37:42 You can the TO_CHAR function to convert date or time values...
In Thunderbird, you can set custom font faces and sizes for reading plain-text e-mails. However, Thunderbird sometimes "randomly" does not respect your choices. This is actually not a...
...some Western (ISO 8859-1), and some maybe yet another encoding. The advanced font settings dialog by default just opens on "Western". Choose a different encoding from the "Fonts for...
Consider this Sass: .comment width: 320px; height: 240px; Any textarea with the comment class will be sized 320 by 240 pixels. In WebKit browsers (Chrome, Safari, ...) or Firefox, this is...
...only the initial size -- users can resize textareas to become bigger. This is helpful to the user, but may be breaking your application layout in some cases.
Variables are colored in the console output You don't need to stringify arguments so the + operator doesn't explode If the variable is a structured object like...
...inside the console and look at its contents Another concise way to write the statement is this: console.log({ foo, bar }); This uses Javascript's new destructuring syntax and is actually...
...exciting" case of auto-loading classes inside a thread which caused the application to stop responding. Rails 4.x ActiveSupport::Dependencies includes logging support. It is easy to use:
...Dependencies.logger = Rails.logger Rails 5+ Logging support was removed for Rails 5. You need to manually patch yourself into the module's code. Here is a dirty solution that works.
Besides their default styling properties, HTML elements have a semantic meaning. For example, an h1 tag is usually styled with a larger font and bold, while it denotes "the single...
...single main content of a page nav for sets of navigation links article for independent, self-contained content section for sections like chapters, typically with a heading aside for content...
...inputs, where one contains the name of the other (eg. Name and Name with special treatment), Capybara's fill_in method will fail with the following message: Ambiguous match, found...
...value = 'Bettertest Cucumberbatch' fill_in(field, with: value, match: :prefer_exact) Furthermore, we recommend setting Capybara's matching strategy globally to :prefer_exact. This will positively affect all you steps...
...some non-default behavior that you know from other tags. Do not try to style html or body for positioning, width/heigth, or similar. Every browser has its own caveats and...
...you can not test them all. Generally speaking: Use the html tag to define your page's default background color (because on short pages or large screens, your body may...
sslscan is a nice tool to show details about TLS/SSL connections: ~> sslscan some-host-at.makandra.de Testing SSL server some-host-at.makandra.de on port 443 Supported Server Cipher(s): Failed SSLv3 256 bits ECDHE-RSA...
...AES256-GCM-SHA384 Failed SSLv3 256 bits ECDHE-ECDSA-AES256-GCM-SHA384 Failed SSLv3 256 bits ECDHE-RSA-AES256-SHA384 Failed SSLv3 256 bits ECDHE-ECDSA-AES256-SHA384 Rejected SSLv3...
...When your tests involve a Rails test application, your tool's Bundler environment will shadow that of the test application. To fix this, just call unset_bundler_env_vars in...
...a Cucumber Before block. Previously suggested solution Put the snippet below into your tool's features/support/env.rb -- now any command run through Aruba (e.g. via #run_simple) will have a clean...
...Rails 2 applications that use RSpec, so don't upgrade if that is your setup. The rspec-rails gem has a fatal bug that was only fixed for rspec-rails...
...x, which only supports Rails 3. There is no fix for the rspec-rails-1.3.x series of the gem which supports Rails 2. Anyway, here are upgrade instructions if...
...fully integrate your Dropbox account(s) into nautilus (Gnome's file manager) with automatic synchronization. Get the .deb file for your system architecture (32 or 64 bit) from the Linux...
...Install the downloaded package using either the Gnome integration (double-click it) or the shell, e.g.: dpkg -i nautilus-dropbox_?.?.?_amd64.deb Follow the graphical installer (use the custom installation for...
...like invoices/generated?number=123. This could be your (very careless) controller method: def generated send_file File.join(Rails.root, 'shared', 'invoices', params[:number]) end This allows your users not only to...
...files but also any files your application can read, like this: invoices/generated?number=../../../../../etc/passwd # => send_file '/etc/passwd' You do not want this. In most cases you should prefer a show...
...Sometimes you have search entries in the autocomplete of the address bar, which are higher weighted than your bookmarks. Pressing SHIFT + DEL while searching removes them from the history immediately...
...Sometimes you have search entries in the autocomplete of the address bar, which are all higher weighted than your recently visited sites. Add a search for your history, so you...
If you want to expand your Areca Raid by swapping out the disks for larger ones you will need to do the following: Swap out all disks one by one...
...and wait until the syncronisation is finished in between. Reboot your server and enter the Raid Controller Configuration by pressing TAB at the right time. In the menu go the...