Quick Tips

2019

2018

2017

The aesthetics of Ruby - Kernel#itself method

Recently, I’ve had quite a popular problem to solve: count the occurences of the given item in a collection. There are few ways to solve this problem - starting from using Enumerable#inject or Enumerable#each_with_obj... Read on →

Ember Tips: Testing Outgoing HTTP Requests

Ember.js is a web frontend framework and it’s no surprise that majority of the applications deal with a lot of HTTP requests. But such fact has a lot of implications on the process of development of the Ember apps, es... Read on →

Ruby Memoization: ||= vs. defined? syntax

In the majority of the Rails applications or even Ruby gems you can find a lot of use cases where you need to memoize a result of some computation for performance benefits and to not compute it again if this result ha... Read on →

Ember Tips: Managing Timeouts And Delays

Timeouts and delays are quite extensively used in many applications when deferring execution of some action via Ember.run.later or debouncing via Ember.run.debounce. Having small amounts of tests executing such method... Read on →

Test Driven Ember - Testing Holding a Button

Thanks to the awesome tools in Ember ecosystem such as ember-cli-mirage, ember-qunit or ember-test-helpers writing majority of the tests is pretty straight-forward. Nevertheless, there are quite a few cases where simu... Read on →

JavaScript Tips: Redefining userAgent property

Imagine a use case where you are trying to check if a user accessed your app from a mobile device or not. Most likely you will need to use navigator.userAgent property and craft some smart regular expression to test ... Read on →

2016