Our CI setup frequently sees this error while running yarn install: yarn install v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages... error An unexpected error occurred: "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz: unexpected end...

...caused by Yarn not retrying npm disconnects which will not be fixed in Yarn 1. Assuming you don't want to upgrade to Yarn 2, here are some workarounds for...

When RubyMine reports Rubocop returning "exit code -1", upgrading Rubocop can be the fix: gem install rubocop "The logs" can...

New versions of wkhtmltopdf dissallow file:// URLs by default. You can allow them by passing --enable-local-file-access.

postgresql.org

...llamas,cats,mice} Removing values Use the array_remove function (Postgres 9.2+) to remove 1 value from the array (all its occurences, should it appear more than once):

{dogs} Bob {llamas} Replacing values Postgres 9.3+ offers array_replace. It will find 1 value (again all occurences) and replace it with 1 given other value. UPDATE users SET...

We stopped using CoffeeScript a while ago, but older projects still use version 1 which transpiles to ES5. This means that examples for transpiled results or the "Try CoffeeScript...

...working on older projects may be somewhat hard. Here are some links to version 1 documentation: http://coffeescript.org/v1/ Fully functional If this ever goes away, here are some alternatives...

The way Rational#to_s works on Ruby has changed from Ruby 1.9 on. Here is how to get the old behavior back. You may want this for things where...

...What's happening? Converting a Rational to a String usually does something like this: 1.8.7 > Rational(2, 3).to_s => "2/3" 1.9.3 > Rational(2, 3).to_s => "2/3" 2.0.0 > Rational...

...you have problems installing a gem and get a error collect2: error: ld returned 1 exit status it's due to missing development headers of a library (ld is the...

...compiling generator.c linking shared-object json/ext/generator.so /usr/bin/ld: cannot find -lgmp collect2: error: ld returned 1 exit status make: *** [generator.so] Error 1 make failed, exit code 2 Gem files will remain...

...the slave from the ground up. stop slave; set global sql_slave_skip_counter = 1; start slave; But what if you have multiple errors which you want to skip? (e.g...

...masters which sync each other) Still do not use a value higher than 1 for sql_slave_skip_counter! Why? Because you can't be sure (without looking into the...

makandracards.com

...of times, maybe thousands of times. Here's how to reproduce the issue: Example 1 # bad code (Time.current .. Time.current + 1.hour).include?(Time.current) # Use Range#cover? instead of Range#include? since...

...the former does no typecasting into integers. (Time.current .. Time.current + 1.hour).cover?(Time.current) Example 2 # bad code Post.where(:created_at => min_date.beginning_of_day .. max_date.end_of_day) # Use 'BETWEEN x AND y...

...records in has_many associations, but none feels smooth. However, when your limit is 1, there is an elegant solution: Simply add validates_uniqueness_of :association_id to your join...

RSpec 1 (Rails 2) With the most recent spec_candy.rb helpers you can say: User.stub_any_instance(:foo => :bar) user = User.new user.foo # => :bar RSpec 2 (Rails 3) RSpec 2 comes with...

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

I encountered a bug in RSpec 1.x where stubbed class methods ("static methods") would not be unstubbed before the next example, causing it to fail. This behavior can come...

...following error after updating the selenium-webdriver gem: wrong number of arguments (0 for 1) (ArgumentError) /home/pointoo-dev/.rvm/gems/ruby-1.8.7-p374/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/common/platform.rb:183:in `open' /home/pointoo-dev/.rvm/gems/ruby-1.8.7-p374/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/common/platform.rb:183:in `ip' /home/pointoo-dev/.rvm/gems/ruby-1.8.7-p374/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/common/platform.rb:196:in `interfaces'

...like >= or ~>. That way it is possible to fetch the latest version of Bundler 1 with this command: gem install bundler -v '~>1' How to install bundler for Ruby...

...is a common usecase where you might need Bundler 1...

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

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

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

web.archive.org

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

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