marvin.soup.io

...this problem when you update your FreeBSD Ports: ===>>> Launching child to update ruby19-iconv-1.9.3.547,1 to ruby20-iconv-2.0.0.576,1 ===>>> All >> ruby19-iconv-1.9.3.547,1 (17/17) ===>>> Currently installed version...

...ruby19-iconv-1.9.3.547,1 ===>>> Port directory: /usr/ports/converters/ruby-iconv ===>>> This port is marked IGNORE ===>>> Not needed with Ruby 2.0 or newer ===>>> If you are sure you can build it, remove the IGNORE...

...occurs in sliders with HTML content. The issue When a slider contains a composited[1] element, the element will overlap any other element when sliding, being rendered as frontmost element...

...or fully, e.g. by using z-index) B is rendered in its own layer[1] C is moved with a CSS transition the transition moves A and B in from...

...middleware yourself. Here is an example that limits concurrency of the "mailers" queue to 1. It uses a database mutex via the with_advisory_lock gem but you could easily...

...rand(4)}" (not perfect, but might be good enough). For rate-limiting (e.g. only 1 job per 5 seconds) you could name it "mailers-throttle-#{(Time.now.to_i / 5.0).to_i...

makandra dev

...was not detected in the system." $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" exit 1 end end Deploying again should now install the missing dependencies as expected...

...array for e.g. one level, it takes an optional argument. # Flattens the array recursively >> [1, [2, [3]]].flatten => [1, 2, 3] # Flattens the array the given number of times

...sed -E 's/:[0-9]+: .*//'`" line_number="`echo $line | sed -E 's/.*:([0-9]+).*/\1/'`" else file="`echo $line | sed -r 's/:[0-9]+: .*//'`" line_number="`echo $line | sed -r...

...s/.*:([0-9]+).*/\1/'`" fi # since $file in working directory isn't always equal to $file in index, # we backup it; thereby we can add our whitespace fixes without accidently...

...some CSS selectors: function floatIn($element) { $element.css({ 'opacity': 0, 'margin-top': 200px }); $element.animate({ 'opacity': 1, 'margin-top': 0 }, { duration: 500 }); } The animation is implemented using setInterval and Javascript. This works...

...as smooth as a CSS transition. Fortunately the animate API can be mapped almost 1:1 to CSS transitions. There are libraries like Transit that act as a drop-in...

makandra dev
semaphoreci.com

...used anywhere inside the Rake tasks. See #Resources at the bottom for examples. Step 1: Upgrade guide For migration from 2 to 3, follow this tutorial: Capistrano 3 Upgrade Guide...

Use the new syntax instead: set :ssh_options, {...

wrong number of arguments (1 for 2) undefined method `tail' for nil:NilClass You need to wrap your task body...

github.com

...always cached prior to actually storing it (to support form roundtrips). Carrierwave by default 1) copies the file to the cache and then 2) copies it again to its final...

ls -1tr * | tail -1 Used switches The -1 switch makes ls return 1 file per line, -t orders by modification time and -r causes sorting from oldest to...

Icon font: little CPU load (no JavaScript) fonts are relatively large 1 extra HTTP request Javascript + inline SVG: higher CPU load (needs to watch the DOM via...

no extra HTTP requests SVG sprites: largest file size, hard to subset 1 extra HTTP request In practice there are probably additional performance tradeoffs. Luckily, there is a...

...you care about performance, never use a query like UPDATE users SET has_message = 1 WHERE users.id IN (SELECT user_id FROM messages) MySQL does not optimize this and seems...

UPDATE users INNER JOIN messages ON messages.user_id = users.id SET has_message = 1 or pipe it through ruby with something like user_ids = ActiveRecord::Base.connection.select_values(Message.select(:user...

Boot partitions from installations prior to the 16.04 era are terribly small. When you install updates and encounter errors due to a full /boot partition, consider risizing it.

...the steps described below, ask someone experienced to help you out. This has worked 100% so far. 1 out of 1 tries. ;) Scenario A: There is unassigned space on your...

...projects, :analytic_stats, :jsonb) Project.reset_column_information Project.find_each do |project| project.analytic_stats = { version: 1, analytics_url: nil, clicks_this_week: 0, clicks_this_month: 0, clicks_this_year...

...ApplicationRecord validate :validate_analytic_stats_against_json_schema has_defaults( analytic_stats: proc { { version: 1, analytics_url: nil, clicks_this_week: 0, clicks_this_month: 0, clicks_this_year...

...increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +-------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+ | test1 | MyISAM | 10 | Dynamic | 3 | 121...

...NULL | utf8_general_ci | NULL | | | | attachments | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 16384 | 3145728 | 1 | 2011-08-17 13:46:48 | NULL | NULL | utf8_general_ci | NULL | | | +-------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+

uri = URI('http://example.com/?foo=1&bar=2') stub_request(:get, 'example.com').with(query: {foo: 1, bar: 2}) Net::HTTP.get(uri) # ===> Success If you only want to check if foo is...

...uri = URI('http://example.com/?foo=1&bar=2') stub_request(:get, 'example.com').with(query: hash_including(foo: 1)) Net::HTTP.get(uri) # ===> Error hash_including doesn't parse query values to string, you need...

Use the PDF toolkit: sudo apt-get install pdftk To rotate page 1 by 90 degrees clockwise: pdftk in.pdf cat 1E output out.pdf # old pdftk pdftk in.pdf cat 1east output...

...out.pdf # new pdftk To rotate all pages clockwise: pdftk in.pdf cat 1-endE output out.pdf # old pdftk pdftk in.pdf cat 1-endeast output out.pdf # new pdftk The E (old pdftk...

makandra dev

...Let's say you split User into the traits "authentication" and "permissions". In Modularity 1 you now had to say: class User < ActiveRecord::Base does 'user/authentication' does 'user/permissions' end

Automatically migrate a project to Modularity 2 If you have been using Modularity 1 with the does syntax, the Modularity 2 gem provides a script to migrate your Ruby...

...Let's say you have this $scope in your Angular controller: $scope.tasks = [ { 'text': 'Task 1' }, { 'text': 'Task 2' } ] And you have this template: {{task.text}} Which renders this HTML:

...bound to the second you can say this in jQuery: var li = $('li:eq(1)'); li.scope().node // => { 'text': 'Task 2' } Or if you'd like to access the entire list...

:T_MODULE=>44, :T_FLOAT=>4, :T_STRING=>65685, :T_REGEXP=>137, :T_ARRAY=>984, :T_HASH=>87, :T_STRUCT=>12, :T_BIGNUM=>2,

:T_COMPLEX=>1, :T_SYMBOL=>29, :T_IMEMO=>5008, :T_ICLASS=>49} Look out for a number that keeps growing over time. Rails In a Rails application...

...query of three random words from the same vocabulary. I used sample sizes from 1,000 to 100,000 records, meaning 50,000 to 5,000,000 indexed words.

...more efficient than I thought For a medium-sized data set of up to 10,000 records (500,000 words) or so, LIKE only takes a fraction of a second...

commandlinefu.com

...helpful when watching them but, since they are ANSI color codes like ^[[4;36;1m, can be annoying when you are reading the logs with a tool that does just...

Remove them with sed: cat staging.log | sed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" This will print the log without colors...

codepen.io

position: absolute; top: 0; bottom: 0; } .section::before { left: calc(50% - 50vw); right: 100%; } .section::after { left: 100%; right: calc(50% - 50vw); } Here is how we place the ::before...

...the viewport width and end up at the very left of the window. right: 100% means that the right side of ::before ends at the left of .section.

...browser based test runner. Should be easily adaptable to a pure Webpack setup. Step 1: Install Jasmine yarn add jasmine-core Step 2: Add two separate packs