Ubuntu 24 added some guarding for Python packages which no longer allows installing applications through pip on system level. Instead...
...will happen and will have effect. But what we can observe is that the behaviour of the callback function :my_method does not happen in the test, as if the...
If you're using a Redis cache in Rails (e.g. :redis_cache_store), it's possible to configure additional parameters...
Newer versions of Bundler (at least since 2.3) have two different behaviors: If your Gemfile.lock reads PLATFORMS: ruby, it might either install a compatible platform-specific version...
...or similar), bundler will install exactly the versions indiciated in the Gemfile.lock. Fix For better consistency, I would advise to make sure you always have PLATFORMS x86_64-linux
...way to calculate the signature is to use an HMAC. Unfortunately, I don't believe you can calculate a proper HMAC in a regular Apache installation. Instead, we do something...
Look-arounds provide a way to match context-dependant. You can look-behind, look-ahead and to both in a positive and negative way. The look-around will...
...Modifiers in Ruby Add modifiers after the final slash, e.g. /Regex/im, or at the beginning of the regex, e.g. /(?i)regex/. i: case insensitivity m: make the .-character also match...
Important You should only implement an implicit conversion method if your object already behaves like the target type. You never create a new object in an implicit conversion method...
...either return self or not be implemented at all. Obviously, this is the reason behind this recent card about Ruby implicitly converting a hash to keyword arguments. It's not...
Here is how to use Chromedriver without libraries like selenium-webdriver. This can be useful for debugging. The following example...
Webpacker uses Babel and Webpack to transpile modern JavaScript down to EcmaScript 5. Depending on what browser a project needs...
2013-02-20 (Tobias) ... with exactly the following rows 2012-06-20 (Henning) Better normalization (more consistent for expected/real input, gets rid of nbsps) 2012-06-01 (Tobias)
...wildcard support (partial matches) 2012-05-25 (Tobias) Better error output; "should not see" now fails if any of the rows is present; cells are now matched exactly, wildcard for...
To do so, call clear_active_connections! before your thread terminates: Thread.new do begin User.first # first database access makes a new connection ensure ActiveRecord::Base.clear_active_connections! end
Expecting a primitive value as an argument to a method invocation is easy: expect(object).to receive(:foo).with('arg1...
...make block elements take up much more space than desired, even stretching their container beyond the screen edge on small screens. min-width is defined to win against competing width...
Sometimes it's necessary for you to check which ports are in use on your local machine and which process...
Looking at the source code of the validates_numericality_of validator, it becomes clear that it converts the attribute in question to either an integer or float: if configuration[:only...
...ActiveRecord::Errors.default_error_messages[:not_a_number]) next end raw_value = raw_value.to_i else begin raw_value = Kernel.Float(raw_value.to_s) rescue ArgumentError, TypeError record.errors.add(attr_name, configuration[:message] || ActiveRecord::Errors.default...
...Although this may be useful for debugging, when writing custom steps you may be better off using XPath...
How a macro can dynamically define a method that can be overridden with super in the same class.
Some pseudo-elements need to be addressed with vendor prefixes. E.g. ::selection is not supported by Firefox, you need to...
If you want to collapse/expand elements with dynamic content (and thus unknown height), you can not transition between height: 0...
Git commits should be very deliberate, and only contain changes that you really want to be in there. In order...
The change_column method for rails migrations support casting with a custom SQL statement. This allows us to change a...
Whenever you create a table from a database migration, remember to add updated_at and created_at timestamps to that...
...read and write access by methods like File.open and File.read. def exclusively_locked_access begin @file_locked = true File.open(F"#{file_path}.lock"), 'w+') do |f| f.flock(File::LOCK_EX...
...that block make sure to do that manually and preferably wrap it it with begin and rescue if something might go wrong: begin f = File.open(file, File::CREAT) f.flock(File...
ActiveModel supplies an errors object that behaves similar to a Hash. It can be used to add errors to a record, as well as to query the record for registered...