This is useful to kill processes like ruby my-script.rb: pkill -f my-script.rb With great power comes great responsibility.
Please don't simply copy line number links from Github. The URL usually contains a branch name like master which...
If you're on Ruby 2.3+ there's a <<~ operator to automatically unindent HEREDOCs: str = <<~MESSAGE Hello Universe!
See this Railscast. Basically you can simply write views like index.xlsx.erb: ID Name Release Date Price <% @products.each do |product| %> <%= product.id...
Write a // and indent every subsequent line by two spaces. This is great for documenting BEM blocks! // An action button...
When you want to look up a class for a given factory, do it like this: >> FactoryBot.factories.find('admin').build_class...
If you want to sort values from an enumerable into two arrays based on whether they match a certain criteria...
jQuery doesn't store information about event listeners and data values with the element itself. This information is instead stored...
This guide shows how to create an AngularJS application that consumes more and more memory until, eventually, the browser process...
The linked article explains how to get a database-wide lock without creating table rows: This article explains how I...
Postgres 9.4 introduces a new column type: jsonb. json and jsonb columns store data differently, so just compare the two...
When you are using the #selector_for helper in Cucumber steps, as e.g. Spreewald does, the following snippet will save...
Enumerable#count can do three things. With no argument provided, it returns the number of items. With an argument, it...
Array#flatten by default flattens an array recursively. To only flatten the array for e.g. one level, it takes an...
I got the 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...
The Javascript in operator does what Hash#has_key? does in Ruby: Return whether an object has a property.
To find a hash key by it's value, i.e. reverse lookup, one can use Hash#key. It's available...
tldr; Use git diff -M or git diff --find-renames when you've moved a few files around. Usage
If your angular app is not served on /, but on a different url (say /admin), links generated with ui-router...
With ActiveSupport you can say: class Robot def self.likes_humans? 'Nope.' end delegate :likes_humans?, to: :class end Robot.likes_humans...
If you want to load an SQL dump from an ActiveRecord migration, you might find this to be harder than...
If you're getting this strange error message when setting debugging breakpoints, probably HAML is the culprit. Cause
I've pushed an update to Cucumber factory that simplifies working with FactoryGirl factories. Say you define a factory with...
If you get this error (probably because you want to load some modules): # modprobe xt_comment FATAL: Could not load...