You will need to upgrade to RSpec >= 2 and rspec-rails >= 2 for Rails 3. Here are some hints to...
This error occurs when passing an object instead of a string to Jasmine's describe(): # Bad describe(HoverClass, function() {...
When you have an element you want to hide, you can add a ng-show='isOpen' attribute to that element...
If your Angular app has some decent complexity, it will not be easy to use UI Router straight away. Here...
In addition to the {{ myValue }} two-way binding syntax, since Angular 1.3 there's a one-time binding syntax, prefixing the value or expression with ::, e.g. {{ ::myValue }}, {{ ::myValue >= 42 }} and...
Use the compile function to change the original DOM (template element) before AngularJS creates an instance of it and before...
Flexbox is awesome. Most of it even works in IE11, but flex: 1 won't work reliably in Internet Explorer. This it because implicitly sets flex-basis: 0 which IE...
...following HTML and CSS. foo bar .container { display: flex; flex-direction: column; } .child { flex: 1; } See it in action at Plunker. Background flex: 1 is a shortcut to flex-grow...
The attached RSpec matcher allows for comfortably testing delegation. Examples describe Post do it { should delegate(:name).to(:author).with...
...an eye on watchers count while developing. Use as a bookmarklet. Works with Angular 1.x Logs to the browser's console...
We will use this for new Angular code. Consider the guide in "beta". Things will still refine, but the general...
A global h2 style probably isn’t going to last more than a month before everyone starts changing it inline...
...~focal] [Ubuntu: 2.0.29-0ubuntu1 2.0.13-2ubuntu0.5 2.0.13-2] libreadline7 (7.0-3) libsodium23 (1.0.18-1+ubuntu18.04.1+deb.sury.org+1) [Ubuntu: 1.0.18-1] libssl1.1 (1.1.1j-1+ubuntu18.04.1+deb.sury.org+3) [Ubuntu...
...1.1.1f-1ubuntu2.16 1.1.1f-1ubuntu2.16 1.1.1f-1ubuntu2] openssl (1.1.1j-1+ubuntu18.04.1+deb.sury.org+3) [Ubuntu: 1.1.1f-1ubuntu2.16 1.1.1f-1ubuntu2.16 1.1.1f-1ubuntu2...
...than it should, this expression requires 4 attempts to match the string: Attempt Group $1 Group $2 Expression result 1 "aaabbb" not matched not matched 2 "aaabb" not matched
...bbb)/ only requires a single attempt to match "aaabbb": "aaabbb" =~ /^(a+)(bbb)/ Attempt Group $1 Group $2 Expression result 1 "aaa" "bbb" matched! Because greedy quantifiers start backtracking when an...
mysql1 50 UP L70K 1 0 0 0 0 0 0 0 mysql2 50 UP L70K 0 1 0 0 0 0 0 0 BACKEND 50 UP
0 0 0 0 8 0 mysql1 is preferred to use as mysql2 is configured as backup. So all connections will be sent to mysql1. We want to do...
@email = email @newsletter = newsletter end end User.new( 'Mr.', 'John', 'Doe', 'Potsdamer Platz 1', '10117', 'Berlin', '+49 0151 1122334455', 'john.doe@example.com', true ) Using keyword arguments Using keyword arguments is easier...
salutation: 'Mr.', first_name: 'John', last_name: 'Doe', street_and_number: 'Potsdamer Platz 1', zip_code: '10117', city: 'Berlin', phone_number: '+49 0151 1122334455', email: 'john.doe@example.com', newsletter: true )
...the method (and not out of the first block or something similar). def test [1, 2, 3].each do |counter| example { return counter } end return 'test' end test # => 1
...when we look at what was said above about the expected return value): # bad [1, 2, 3].each { |counter| break counter if counter.even? } # => 2 [1, 3].each { |counter| break counter...
In RubyMine you can use find and replace with capture groups (.*?) and backreferences $1 (if you have several groups: $[Capture-Group ID]). Named captures (? .*) are also supported. Examples
...expression captures whatever is contained by two double quotes. Fill in replace field with '$1'. The $1 references what was captured. RubyMine shows you a preview of the result, so...
...opening a form, JavaScript makes a request to acquire a lock for that record (1). After 20 seconds the JavaScript starts polling the server (2), to check if another user...
When the PC was low on resources (parallel_tests), acquiring the lock (1) took so long that the client starts polling for updates (2) before the initial lock...
...options = Selenium::WebDriver::Chrome::Options.new options.add_argument('--disable-infobars') options.add_emulation(device_metrics: { width: 1280, height: 960, touch: false }) unless ENV.key?('NO_HEADLESS') options.add_argument('--headless') options.add_argument('--disable-gpu...
...app, browser: :chrome, options: options) end Selenium::WebDriver.logger.level = :error Headless Chrome in legacy Capybara 1 projects If you're working on a legacy project with Capybara version 1.x, the...
...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 | | +----+-------------+-------+-------+----------------------+----------------------+---------+-------+------+-------+
...data types. Like integers for string fields: mysql> EXPLAIN SELECT * FROM users WHERE email = 12345; +----+-------------+-------+------+----------------------+------+---------+------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+----------------------+------+---------+------+--------+-------------+
echo "> Deleting remote branch ..." git push origin --delete $merged_branch_name exit 1 else echo "x Did not delete the \"$merged_branch_name\" branch." fi
...the branch deleted: $ git merge ds/foo Updating 338e82e38..2d4269c81 Fast-forward foo | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 foo > You have just merged the...
...the copied invoice and the creation of its items. This list of changes (e.g. 12 INSERT statements) will be committed in a single atomic operation, or not at all. This...
...order, you might get a deadlock. For instance, transaction A wants to change row #1 and row #2. Transaction B wants to change the same rows, but in different order...
...You might think that the following queries yield the same result: User.where(movie_ids: [16, 17]) User.where(movie_ids: [17, 16]) Turn's out - they are not! They do care...
...the where_array_matches method below. Note that it does not care about duplicates - [1, 2, 2] is handled identically to [1, 2]: # lib/ext/active_record/relation.rb class ActiveRecord::Relation def where_array...