...this matter, as the image rendering depends on multiple factors. At least the operation system, browser or image viewer software and monitor influence the resulting image colors on your screen...
...possibility to upload images, they will most likely contain tons of EXIF metadata and sometimes exotic color profiles like eciRGB. We want to get rid of the metadata, as it...
Since Rails 5, domain models inherit from ApplicationRecord by default. This is the place to put code that should be available in all your application's models.
RSpec supports a one-liner syntax for setting an expectation on the subject: describe Array do describe "when first created" do it { should be_empty } end end The example description...
...it should be empty" will be defined automatically. With RSpec 3's expect-based syntax you use it_is_expected instead: describe Array do describe "when first created" do
...errors.add_to_base('failed') if bad_things? end end ^ # app/models/foo.rb require 'user' class Foo # something happens here end Now, when your environment is booted, Rails will automatically load your models...
...our example, when Foo gets loaded, it will require the User class itself again. Since Ruby 1.8 identifies required files by the string you used (as you alread know), this...
The bin/webpack-dev-server command is not as smart as e.g. rails server, where it shows the proper fix within the error message. $ bin/webpack-dev-server yarn run v1.19.1 error Command "webpack-dev-server...
...like the rest of your Bootstrap 4 application. Rome comes with very little basic styling. While we could redefine its classes, we can configure the classes Rome applies to its...
...This is because Rome also uses styles internally as selectors which breaks internal behavior for space-separated strings or when using the same CSS class for multiple properties (e.g. text...
Consider the following: describe '#something' do context 'with lots of required arguments' do it 'should work' do subject.something(:foo => 'foo', :bar => 'bar', :baz => 'baz').should == 'Hello world' end it 'should...
...is actually called. This way you can manipulate objects or other data before using the short-hand reference to your method call. Yes, it is quite similar to using variables...
MySQL will use the index when your query is well-formed: mysql> EXPLAIN SELECT * FROM users WHERE email = 'foo@example.com'; +----+-------------+-------+-------+----------------------+----------------------+---------+-------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len...
...ref | rows | Extra | +----+-------------+-------+-------+----------------------+----------------------+---------+-------+------+-------+ | 1 | SIMPLE | users | const | index_users_on_email | index_users_on_email | 768 | const | 1 | | +----+-------------+-------+-------+----------------------+----------------------+---------+-------+------+-------+ However, indexes are not used if you are passing incorrect data types...
...alpha channel value, you can use Gimp: Use the color picker tool Hold the Shift key while clicking the pixel A window will appear, containing color information, including the alpha...
...intrinsic width of your content play together. The attached article explains the differences. In summary: If a flex-basis is set, that is used as the basis
...basis is set, the width is used as the basis If neither flex-basis nor width is set, the content's computed width is used as the basis
...its advisor model to clarify its approach or to get "help" in more complex situations (like planning or debugging). How to use In Claude Code, type /advisor to open a...
...as an argument to the /advisor command. /advisor fable Your chosen advisor model is saved to your Claude Code settings file; new sessions will use it by default. Currently (August...
By default parallel_tests will spawn as many test processes as you have CPUs. If you have issues with flaky tests, reducing the number of parallel processes may help.
...Flaky test suites can and should be fixed. This card is only relevant if you need to run a flaky test suite that you cannot fix for some reason. If...
If you want to make your Rails application be capable of sending SMTP emails, check out the action mailer configuration section in the Ruby on Rails guide.
...will end up having an smtp_settings hash that looks something like this: smtp_settings = { address: ..., domain: ..., port: ..., user_name: ..., password: ..., authentication: ..., tls: ..., enable_starttls_auto: ..., } This hash can be...
yield(Nokogiri::XML(node.outer_xml).root) end end end end This will simply yield regular Nokogiri nodes...
This is a presentation from 2019-01-21. Summary We want to move away from jQuery in future projects Motivations are performance, bundle size and general trends for the web...
...can polyfill the missing pieces Unpoly 0.60.0 works with or without jQuery Is jQuery slow? From: Sven To: unpoly@googlegroups.com Subject: performance on smartphones and tablets Hello I just used your...
Luckily, this is simple. Just install three packages: sudo apt install ipheth-utils libimobiledevice-dev libimobiledevice-utils Then turn on the "Personal Hotspot" in iPhone settings, connect it to your...
...programmers dislike meetings so much is that they're on a different type of schedule from other people. Meetings cost them more...
whatsmydns.net is an online service that allows you to instantly perform a DNS lookup to check a hostnames current IP Address and other DNS information against a selection of random...
...name servers around the world. This is especially useful to check the current state of DNS propagation after making changes to your domains zones...
In a recent post, Stephan Schmidt makes several suggestions in order to write "Next Generation Java". Unfortunately, I disagree with most of them
Let's say you have a gem which has the following module: # within the imaginary super gem module SuperClient def self.foo 'Foo' end def bar 'Bar' end end
...library extensions). Try to avoid it if possible. Add a lib/ext/super_client.rb to your project (see How to organize monkey patches in Ruby on Rails projects) Add the extension, which overrides...
When working with feature branches, stale branches pile up over time. It's best to remove them right after merge, locally and on the remote, but it is a little...
...above). Paste this: #!/bin/bash exec < /dev/tty # Get the current branch name branch_name=$(git branch --show-current) # Get the name of the branch that was just merged reflog_message=$(git...
...cases beyond that to make your life easier. For this cheatsheat I tried to structure the most useful commands by different use cases, such that a practical oriented overview of...
...some commands I added some tips for their usage and further details on their subcommands For most of the commands shortly explained here, there are some examples along with a...