...to issues, since string comparisons are case-insensitive in MySQL. (If you use PostgreSQL, read this instead.) Say you have a user model class User < ActiveRecord::Base validates_uniqueness_of...
...Installed at (1.4.1): /home/arne/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0 (1.3.5, default): /home/arne/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0 Interactive Ruby command-line tool for REPL (Read Eval Print Loop). Type gem help info to see a list of available switches.
...Dependency.new("reline", Gem::Requirement.new([">= 0.3.0"]), :runtime)] s.description = "Interactive Ruby command-line tool for REPL (Read Eval Print Loop)." s.email = ["keiju@ruby-lang.org"] s.executables = ["irb"] s.files = ["exe/irb"] s.homepage = "https://github.com/ruby/irb" s.licenses = ["Ruby...
...can reference global variables with an english name. This makes you code easier to read and is also suggested by Rubocop's Style/GlobalVars cop. Example before: if 'foo' =~ /foo/
...SEPARATOR => $, $RS => $/ $INPUT_RECORD_SEPARATOR => $/ $ORS => $\ $OUTPUT_RECORD_SEPARATOR => $\ $INPUT_LINE_NUMBER => $. $NR => $. $LAST_READ_LINE => $_ $DEFAULT_OUTPUT => $> $DEFAULT_INPUT => $< $PID => $$ $PROCESS_ID => $$ $CHILD_STATUS => $? $LAST_MATCH_INFO => $~ $IGNORECASE => $=
...architecture. Most likely, you need to put [arch=amd64] after deb so that it reads deb [arch=amd64] https://... or deb [arch=amd64 signed-by=.... Workaround Step 2: Connect with...
...top-right editor corner (or hit Ctrl + Shift + Y) and select "Start Session". Choose permissions: "Read-only" lets others only watch you. "Edit files" is needed for pairing. Note that...
.../LATEST_RELEASE" VERSION=$(curl -f --silent $VERSION_URL) if [ -z "$VERSION" ]; then echo "Failed to read current version from $VERSION_URL. Aborting." exit 1 else echo "Current version is $VERSION"
...whenever your Chrome is updated, run update-chromedriver and after one second you are ready to go. Example output: $ update-chromedriver Current version is 77.0.3865.40 Downloading to /tmp/chromedriver-77.0.3865.40.zip
...The article explains about how sharing setup between examples make test files harder to read and evolve. A related frustration I have is working on ultra-DRY & betterspecs-like test...
...which map to one context, e. g. mail components, in order to provide better readability of your tests or to even make clear a tests fail reason due to some...
...user with the mail address user@somedomain.com. For Console Debugging If you might want to read out the result of at least one failing expectation for different expected values without interrupting...
Code comments allow for adding human readable text right next to the code: notes for other developers, and for your future self. You can imagine comments as post-its (or...
...concept. Probably it is a good idea to mention that concept in the project README, but it should direct the reader to the module for details. In the same manner...
...blog post on the official Ruby blog going into the details. You should probably read that, but here is a slightly abbreviated version: What changed When the last argument of...
In ruby you can easily read and write CSVs with the standard CSV library class. On top of this, you can use the gem smarter_csv for reading (not writing...
Why Rails has multiple schema formats When you run migrations, Rails will write your current database schema into db/schema.rb. This...
...examples can get quite long, especially in feature specs. This makes them hard to read & understand. Also, when executing them, it may take seconds to see any progress.
...same object in memory, instead of loading another copy of the same record. Please read this great section about bi-directional associations from the Rails API for details.
...tests with PARALLEL_TEST_PROCESSORS=#{physical_cpu_count}.") end rescue CannotReadCPUCount => e warn('Cannot read CPU count: ' + e.message) end private def process_count if (env_value = ENV['TEST_ENV_NUMBER...
...to keep your test databases clean, if you're running multiple databases with full read and write access at the same time. This is especially useful when migrating old/existing databases...
...class MigrationRecord < ActiveRecord::Base self.abstract_class = true connects_to database: { writing: :my_app_migration, reading: :my_app_migration } # You never want to allow write access to the database you are...
...user into the ETag of all actions def show ... end def index ... end end Read more Default controller implementation (with caching...
...duration // => 210ms An example is storing a transition duration as CSS custom property to read it from Javascript. By converting the value like this, you can ensure your Javascript will...
...Optimizer squashes it and can shrink SVGs to a fraction of their original size. Read on 5 SVG Gotchas How to scale SVG Visual comparison of different combinations of SVG...
...plain Net::HTTP: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed Here is how to fix that in your application...
...RestClient.get('https://self-signed.badssl.com/') RestClient::SSLCertificateNotVerified: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed Self-signed certificates are basically fine, they were simply...
...DEBUG_OPEN=chrome. The chrome devtools will open and connect to the debugger automatically. Read the docs about remote debugging for details...
...how the SELECT statement at the end is rather short and much easier to read. The CTE SELECTs are also quite readable. Imagine how a JOINed statement would look like...
...convoluted control flow inherently concurrent computer spends no time waiting for IO (accepting request, reading from database, pushing HTML over network) time can be spent by switching to next context...
done: callbacks.done }) } }) } }) } refreshUsers({ done: function() { console.log('Users refreshed!') } ); This is hard to read! If any step in the chain has an error, the chain silently stops Callbacks with...
...enables pulling default = current # Match remote branch with same name For more configuration examples, read on. Please only use configuration that you understand. Aliases [alias] amend = commit -v --amend # Amend...