Ruby 2.3.0 has been around since end of 2015. It brings some pretty nice new features! Make sure to read...
...complain about calling nil.name or nil.macro while it tries to process the association list. Best practice Make sure to do it this way: params.to_hash.symbolize_keys.merge(:include => { :user => :avatar }) (Note that params.to...
Copy and paste at will, they're free! German quotation marks: „ “ (Ubuntu-Hotkey: AltGr+v and AltGr+b) English quotation...
...Add development to existing environments in the Raven.configure block: config.environments = ['development', 'staging', 'production']. Remove better_errors from Gemfile if existing and bundle. With Raven.capture_message('Test from development') you can...
When using the json gem, you might run into this error when using JSON.parse: >> json = 'foo'.to_json >> JSON.parse(json...
You can scale background images in CSS to the container size using background-size (Demo). Commonly, we use contain or...
TLDR: When you put CSS rules into a partial and import that partial multiple times, the CSS rules will be...
With defaults, RCov doesn't work the way you how you would like it to. To create a nice test...
Some modern Javascript APIs return iterators instead of arrays. In plain Javascript you can loop through an iterator using
Your after_commit callbacks will not know about changes, as Rails discards them when committing. The linked article shows a...
...that you can use to travel through time and trigger setTimeout and setInterval callbacks: beforeEach(function() { timerCallback = jasmine.createSpy("timerCallback"); jasmine.clock().install(); }); afterEach(function() { jasmine.clock().uninstall(); }); it("causes a timeout to...
User Stories should describe what a user wants the system to do. Purely technical tasks should usually be implemented as...
If your project depends on an old version of ImageMagick that you can no longer install in your system, you...
Webfonts are not always available when your JavaScript runs on first page load. Since fonts may affect element sizes, you...
For some years Google Chrome has allowed you to add desktop icon for any web page by going to Tools...
Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead. This issue will be encountered when relying on attribute_was methods...
...model, for example. In my case a record with an assignable_values legacy value became invalid when it should not. The initializer in the attached file will fix this issue...
Normally you can list all gems of the current ruby version with gem list, which also includes the gems of...
...deployment output appear less noisy, it also hides information that could be helpful. I believe you should prefer knowing what is going on, even if causes a few extra lines...
To open a terminal quickly navigate to System → Preferences → Keyboard Shortcuts. There, click the "Run a terminal" row (It should...
...rc1) must be separated by a dash, like this: 1.0.0-rc1 2.3.0-alpha2 3.0.0-beta3 Publishing to a pre-release tag npm packages have multiple "current" releases, identified by "tags...
Run bundle update cucumber capybara cucumber-rails to update to the newest versions. Backup your features/support/path.rb to be able to...
...methods") would not be unstubbed before the next example, causing it to fail. This behavior can come and go as you edit your specs, since this can change the order...
...evaluates your .rb files. I was not able to find a fix for this behavior. Calling #rspec_reset und #unstub!(:method) on the class after the example did not help...
Sometimes you want to preload images that you will be using later. E.g. if hovering over a an area changes...
Sometimes you want to test migrations with production or staging data. Dumping single tables makes sense if a complete dump...