...to affect the whole container text, not separate children. For example, .container %p Text 1 %p Text 2 %p Text 3 with .container display: -webkit-box would be shown as...

...find out about #fill but it is not really what you are looking for. [1] For arrays of unknown size that you want to grow or shrink to a fixed...

...sized << fill_with while sized.size < expected_size sized end end Use it like this: >> [1, 2, 3].in_size(5) => [1, 2, 3, nil, nil]

RSpec 1, RSpec 2 To test whether two arrays have the same elements regardless of order, RSpec 1 and 2 give you the =~ matcher: actual_array.should =~ expected_array Rspec 3

...you can choose one of these two matchers: expect(actual_array).to match_array(['1', '2', '3']) expect(actual_array).to contain_exactly('1', '2', '3') Note how match_array...

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

getbootstrap.com

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

Example display configuration Screen 0: minimum 8 x 8, current 5760 x 1200, maximum 32767 x 32767 eDP1 connected 1920x1080+0+0 (normal left inverted right x axis...

...y axis) 276mm x 155mm 1920x1080 60.00*+ 59.93 1680x1050 59.95 59.88 1600x1024 60.17 1400x1050 59.98 1600x900 60.00 1280x1024 60.02 1440x900 59.89 1280x960 60.00 1368x768 60.00 1360x768 59.80 59.96

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

...to set a default region and the JAVA_HOME: export EC2_REGION=eu-west-1 export EC2_URL=https://eu-west-1.ec2.amazonaws.com export JAVA_HOME=/usr Add a bash script somewhere in...

...your $PATH (I called it am): #!/bin/bash if [[ $1 == "list" ]]; then cd ~/.aws && git branch -l elif [[ $1 != "" && `cd ~/.aws && git branch | grep $1` ]]; then cd ~/.aws && git checkout $1...

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

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

...XML.inner_text(column).include? expected_column.strip end if first_column.nil? false else row = row[(first_column + 1)..-1] true end end end if first_row.nil? false else rows = rows[(first_row + 1...

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

makandra dev
dev.mensfeld.pl

Hashes can now be compared like numbers: <, >, <=, >=, which checks for (proper) subsets. {a: 1} >= {a: 1} # => true {a: 1} > {a: 1} # => false Numeric predicates Numeric#positive? and Numeric#negative...

...allow for easy filtering: [1, -4, 2, -100].select &:positive? # => [1, 2] Negative grep Enumerable#grep_v excludes from the result set. It's similar to Rails' #reject:

stackoverflow.com

mysql> SELECT @@global.version; +------------------+ | @@global.version | +------------------+ | 5.6.30 | +------------------+ 1 row in set (0,00 sec) MySQL 5.6 Reference Manual says "BLOB and TEXT columns cannot have DEFAULT values". If you want to run...

...an application-side default. You can use a gem like has_defaults for that. 1. Temporally change the migration code Replace things like: create_table "some_table", :force => true do...

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

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

...by the group_concat_max_len system variable, which has a default value of 1024. This will cause horrible, data-destroying bugs in production. For this reason you should probably...

...id | user_id | title | +----+---------+-----------------+ | 8 | 5 | How to rock | +----+---------------------------+ | 9 | 5 | Shoes are weird | +----+---------------------------+ | 10 | 5 | Best song | +----+---------------------------+ | 11 | 6 | Sunny day | +----+---------------------------+ | 12 | 6 | Greetings | +----+---------------------------+ For each user_id we...

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

...syntax is a bit different. UnderscoreJS In UnderscoreJS, methods always return a value: x = [1, 2, 2] _.uniq(x) // => [1, 2] _(x).uniq() // => [1, 2] If you want to chain...

...call value() to terminate the chain. _.chain(x).uniq().map(function(i) { return i + 10 }).reverse().value() // => [12, 11] LoDash In LoDash, methods called from _ (like _.uniq) will behave as...

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

...queries (simplified; the number at the beginning of each line is the connection ID): 1 Connect 1 BEGIN 1 INSERT INTO foos 1 Quit 2 Connect 2 SELECT COUNT(*) FROM...

...you insert a record "by hand". This will cause an error: record = Record.create! record.id # => 100, next automatic id will be 101 Record.create!(id: record.id + 1) # okay, but next automatic id...

...will still be 101 Record.create! # will cause an SQL error 'duplicate key value violates unique constraint "records_pkey"' Workaround In tests, one workaround would be to simply initialize all sequences...