When building an application that sends e-mails to users, you want to avoid those e-mails from being classified as spam. Most obvious scoring issues will not be relevant...

...to you because you are not a spammer. However, your application must do one thing by itself: When sending HTML e-mails, you should include a plain-text body or...

Event delegation is a pattern where a container element has a single event listener that handles events for all descendants that match a CSS selector. This pattern was popularized by...

...element was clicked!") }) This technique has some advantages: When you have many descendants, you save time by only registering a single listener. When the descendants are changed dynamically via JavaScript...

Fixed bugs where calling valid? would change the record's state...

...config={}). There also is a generate method which will run the generator in a subprocess. Call it with generate 'generator_name', 'command line args'. Expected (hard-coded) directory structure of...

... #{generator name, e.g. model}_generator.rb USAGE Templates If you want to use the supplied template, directory and other template methods, you must call source_root 'path/to/templates' inside your generator...

Both knapsack and parallel_tests have the option to split groups by historic execution time. The required logs for this might be outdated since you manually have to update and...

...consistently up to date with no extra effort locally and/or remotely. How to always split by execution logs Parallel Tests The parallel_tests gem has the option flag --group-by...

makandra dev

...possible to only use -f pretty for the rerun. Drawbacks: MAJOR: With our current setup, when the main run fails without writing a tmp/failing_features.txt (e.g. due to a syntax error...

...the CI job will pass MINOR: With our current setup, we lose the test coverage of the main run A fix for the passing CI despite syntax error could look...

This is super stupid: In the Thunar file manager, select the file Go to File / Properties / Open With (WTF!) Select the preferred application from the list and hit "Set default...

...This setting will apply to all files with that extension...

...This release has many minor changes and fixes to prepare your application for Rails 3. Step-by-step upgrade instructions: Upgrade rails gem Change your environment.rb so it says RAILS...

...for a detailed list of changes. 2.3.9 to 2.3.10 Fixes Vulnerability in Nested Attributes code. Step-by-step upgrade instructions: Upgrade rails gem Change your environment.rb so it says RAILS...

In your ~/.gitconfig: [core] editor=nano

...this card, we describe a wrapper for it that humanizes a given number of seconds in the "next best" unit, like seconds, minutes, etc. Example usage >> new Duration(42).humanized...

>> new Duration(123456).humanized() => '1 Tag' >> new Duration(123456).humanized('es') => '1 día' Code Here is the code as an ECMAScript module. Note that we default to German in...

...Repeat Yourself (or DRY). In Ruby on Rails we keep our code DRY by sharing behavior by using inheritance, modules, traits or partials. When you reuse behavior you want to...

...writing integration tests with Cucumber, where you need to express yourself with Gherkin and step definitions instead of Ruby classes and methods. But don't dispair! Below you will find...

Settings -> Editor -> General -> Smart Keys -> Unindent -> To nearest indent position RubyMine 7.0: Settings -> Editor -> General -> Smart Keys -> Backspace smart indent -> uncheck

Icon fonts like Font Awesome are infinitely scalable, look great on high-DPI displays and will give your app a modern look. However, icon fonts can be very awkward to...

...use compared to raster icons. Elements are given icons by giving them a special class like icon-plus or icon-home: Create The icon font's stylesheet will then recognize...

With ActiveSupport you can say: class Robot def self.likes_humans? 'Nope.' end delegate :likes_humans?, to: :class end Robot.likes_humans? # => 'Nope.' Robot.new.likes_humans?

...latest commits are not ready for production? Then use git merge master~n to skip the n-last commits. Tip A big advantage of merging vs. cherry-picking is that...

SVG is an acronym for "scalable vector graphics". SVGs should be used whenever an image can be described with vector instructions like "draw a line there" or "fill that space...

...they're not suited for photographs and the like). Benefits are the MUCH smaller file size and the crisp and sharp rendering at any scale. It's a simple, old...

rubylearning.com

This article will show you how to use throw and catch. It's a nice tool to break out of multiple loops when a result is obtained.

...card Ruby: A small summary of what return, break and next means for blocks...

brandcolors.net

brandcolors.net provides you with the colors of the world's biggest brands, easily searchable...

doubleyourfreelancing.com

How you can unknowingly screw your client's business when all you think about is closing the next user story...

robots.thoughtbot.com

Rails 4.0 introduced a helpful new method for ActiveRecord queries: where.not. It can make clunky queries easier to read.

igvita.com

About Chrome's network stack and optimizations to load web pages faster...

makandra dev
bitbucket.org

Makes a robust determination of a user's timezone through Javascript.

martinciu.com

How to make class_attribute behave like class_inheritable_attribte which no longer exists in Rails.

0xfe.blogspot.com

Chrome now supports desktop notifications using WebKit's webkitNotifications API. This means you can create popup bubbles from Javascript...