...following snippet: echo -n "md5"; echo -n "${PG_PASSWORD}${PG_USERNAME}" | md5sum | awk '{print $1...
...is out of range (Redis::CommandError) This is because Redis defaults to at most 16 databases (0 to 15) and running tests in parallel might exceed that (your tests might...
...run on databases 1..n or 2..(n+1)). You can increase that limit: Get number of CPUs of your machine. nproc --all Open up Redis configuration file.
...but must also render nicely for browsers that don't support it (mostly Safari <17.5). Step 1: Put some s into your HTML First, place explicit line breaks that should...
...look for another clockpicker or overwrite the styles by using bootstrap variables. Upgrade Phase 1 First you should include the new version into your project and replace the old imports...
...say you have a database schema where an Employee belongs_to :department: +-----------------+ | Employee | +------------+ |-----------------| n 1 | Department | | email |-------------------|------------+ | department_id | | name | +-----------------+ +------------+ Because of performance reason you decide to cache the department...
...s name into a new column Employee#department_name: +-----------------+ | Employee | +------------+ |-----------------| n 1 | Department | | email |-------------------|------------+ | department_id | | name | | department_name | +------------+ +-----------------+ You add the column like this: ALTER TABLE employees ADD COLUMN...
...with "INFO" in green: tail -f /path/to/log | sed --unbuffered -e 's/\(.*INFO.*\)/\o033[32m\1\o033[39m/' -e 's/\(.*FATAL.*\)/\o033[31m\1\o033[39m/' Here are the most common...
...into pairs of two, you can use the Rails ActiveSupport method in_groups_of: >> [1, 2, 3, 4].in_groups_of(2) => [[1, 2], [3, 4]]
...in_groups_of(2) => [[1, 2], [3, 4], [5, nil]] >> [1, 2, 3, 4, 5].in_groups_of(2, 'abc') => [[1, 2], [3, 4], [5, 'abc']]
...by setting the left and right margins to auto, for example: // SASS $container_width: 100px .container width: $container_width margin: 0 auto However, this won’t work on an absolutely...
...positioned element. But there is a solution: // SASS $container_width: 100px .container width: $container_width position: absolute left: 50% margin-left: floor($container_width...
User.singleton_class.ancestors # => [# , B::ClassMethods, A, # , # , Class, Module, Object, Kernel, BasicObject] User.singleton_class.class # => Class User.singleton_class.ancestors[1].class # => Module Note that # is the singleton class and as we have seen the parent...
...number of attributes that will be set, then call the original method: movie = Movie.find(1) movie.attributes = { title: 'Sunshine', year: '2007' } # Console prints "Setting 2 attributes" # Check that the original #attributes...
...t be able to call gsub with a block and match reference variables like $1. They will be nil inside the block where you define replacements (as you already know...
...Here is a fix to SafeBuffer#gsub. Note that it will only fix the $1 behavior, not give you a safe string in the end (see below). Example
...f mysql5.1 -d "default parameter with utf8" --aws-credential-file ./aws-credential.txt --region eu-west-1 The output should look like this: DBPARAMETERGROUP utf8 mysql5.1 default with utf8 Now change the...
...parameter of the new parameter group /home/foobar/Downloads/RDSCli-1.4.007/bin/rds-modify-db-parameter-group utf8 --region eu-west-1 --aws-credential-file .aws-credential.txt \ --parameters="name=character_set_server, value=utf8, method=immediate" \ --parameters="name=character_set_filesystem...
...database_size('some-database')); Example SELECT pg_size_pretty(pg_database_size('cards_p')); ---------------- 13 GB (1 row) SELECT pg_database_size('cards_p'); pg_database_size ------------------ 13524832927
Consider the following git diff output. diff --git a/file1.rb b/file1.rb index 806ca88..36d536b 100644 --- a/file1.rb +++ b/file1.rb @@ -1,7 +1,5 @@ -# Here is a useless comment. -# It will be removed...
+ def bar # ... end end diff --git a/file2.rb b/file2.rb index 550e1c6..600f4e3 100644 --- a/file2.rb +++ b/file2.rb @@ -1,6 +1,5 @@ -# Here is another useless comment. class File2
...reason) not rendered in controller specs. If you need it to happen, use: RSpec 1 (Rails 2): integrate_views RSpec 2 (Rails 3): render_views Note that you can't...
Here is one pretty easy solution to get what you want: Step 1 Let your input became a text area with one row. f.text_area(:name, rows: 1...
Specify these gem versions in your Gemfile: gem 'cucumber', '~> 1.3.0' gem 'cucumber-rails', '= 0.3.2' # max version for Rails 2 gem 'capybara', '< 2' # capybara 2+ requires Rails 3 gem 'mime-types...
...dependeny of capybara gem 'nokogiri', '< 1.6' # dependency of capybara gem 'rubyzip', '< 1' # dependency of selenium-webdriver, rubyzip 1+ requires Ruby 1.9 gem 'cucumber_factory' gem 'database_cleaner', '< 1'
...threads, that handle the incoming requests. Example: A Puma server with 2 workers and 1 thread each can handle 2 request in parallel. A third request has to wait until...
...but once one thread is blocked, another can continue. Example: A Puma server with 1 worker and 2 threads can handle 2 requests. A third request has to wait until...
Add a reminder to your calendar: Repeat the learnings of the last 10 curriculum cards every other monday Read the article "Parting advice from an older Software Engineer...
...Try to memorize the key takeaways of 1-5 on the list. Watch Dominik's talk "Test-Led Development" (in our library) and try to apply his technique in the...
...rd|th) (role|showtime) fields?\z/ ".nested-fields .nested-fields--form:nth-of-type(#{$1})" end end end World(HtmlSelectorsHelpers) nth-of-type matches by counting the actual HTML-tag...
Scenario: Example scenario Given ... When I fill in "Character" with "Kaiser" within the 1st role fields And I select "Moon" from "Movie" within the 1st role fields
...example, if you need to support ancient browsers: { "presets": [ ["env", { "modules": false, "targets": { "browsers": [ "> 1%", "Firefox >= 52", // old ESR "IE 11" ], "uglify": true }, "useBuiltIns": true }] ] } UglifyJS also has compatibility settings...
...always agree with. We recommend replacing this with makandra-rubocop or disabling the inspection. 1. Adding the gem to an existing code base Follow the instructions in the README. Most...
when 'the homepage' root_path when /^the list of (.*?)$/ models_prose = $1 route = "#{model_prose_to_route_segment(models_prose)}_path" send(route) when /^the (page|form...
...for the (.*?) above$/ action_prose, model_prose = $1, $2 route = "#{action_prose == 'form' ? 'edit_' : ''}#{model_prose_to_route_segment(model_prose)}_path" model = model_prose_to_class(model_prose)
...equality matchers) like this: beforeEach -> jasmine.addMatchers toEqual123Array: (util, customEqualityTesters) -> compare: (actual) pass: util.equals(actual, [1, 2, 3], customEqualityTesters) Note how the compare method is passed two arguments util and customEqualityTesters...