You will need to upgrade to RSpec >= 2 and rspec-rails >= 2 for Rails 3. Here are some hints to...

When you have an element you want to hide, you can add a ng-show='isOpen' attribute to that element...

This error occurs when passing an object instead of a string to Jasmine's describe(): # Bad describe(HoverClass, function() {...

makandra dev

If your Angular app has some decent complexity, it will not be easy to use UI Router straight away. Here...

docs.angularjs.org

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...

web.archive.org

Use the compile function to change the original DOM (template element) before AngularJS creates an instance of it and before...

plnkr.co

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...

makandra dev
gist.github.com

The attached RSpec matcher allows for comfortably testing delegation. Examples describe Post do it { should delegate(:name).to(:author).with...

gist.github.com

...an eye on watchers count while developing. Use as a bookmarklet. Works with Angular 1.x Logs to the browser's console...

github.com

We will use this for new Angular code. Consider the guide in "beta". Things will still refine, but the general...

themomorohoax.com

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...

makandra Operations

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...

...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...

...mentioned below for your deployment on request. If you're lucky DO_NOT_TRACK=1 opts you out of CLI telemetry - it's not widely adopted. When you're using...

...yarn config set --home enableTelemetry 0 Next.js https://nextjs.org/telemetry export NEXT_TELEMETRY_DISABLED=1 Prisma https://www.prisma.io/docs/orm/tools/prisma-cli#telemetry export CHECKPOINT_DISABLE=1 Angular https://angular.io/cli/analytics Note: The default...

docs.ruby-lang.org

...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...

@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 )

...column_value(value) method in active record is traced (simplified output): git log -n 1 --pretty=oneline -G 'convert_number_column_value(value)' -- activerecord/lib/active_record/base.rb ceb33f84933639d3b61aac62e5e71fd087ab65ed Split out most of the...

...activerecord/lib/active_record/base.rb - def convert_number_column_value(value) - if value == false - 0 - elsif value == true - 1 - elsif value.is_a?(String) && value.blank? - nil - else - value - end - end activerecord/lib/active_record/attribute_methods/write.rb + def convert_number_column...

...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...

guides.rubyonrails.org

...database's EXPLAIN style. For example, it looks like this on MySQL: User.where(id: 1).includes(:articles).explain EXPLAIN for: SELECT `users`.* FROM `users`  WHERE `users`.`id` = 1 +----+-------------+-------+-------+---------------+

...type | table | type  | possible_keys | +----+-------------+-------+-------+---------------+ |  1 | SIMPLE      | users | const | PRIMARY       | +----+-------------+-------+-------+---------------+ +---------+---------+-------+------+-------+ | key     | key_len | ref   | rows | Extra | +---------+---------+-------+------+-------+ | PRIMARY | 4       | const |    1 |       | +---------+---------+-------+------+-------+   1 row in set (0.00 sec)   EXPLAIN for: SELECT `articles...

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...