Sometimes you want to load code on demand. For instance, when a a large library is only used on a...
Since May 2011 we are cutting new gems using Bundler, which is less painful than cutting gems using Jeweler. You...
When such a virtual attribute should contain integer values you might get unexpected behavior with forms, because every param is a string and you don't get the magic...
When using git diff, you might encounter weird characters where umlauts (or any other UTF-8) characters should be. It...
You know that you can use jQuery's text() to get an element's contents without any tags.
...on table rows (use case would be clicking the 1st link inside it for better UI). Consider this setup: hello ^ $(document).on('click', 'tr', function () { alert('row clicked') });
When building a form with a file select field, you may want to offer your users a live preview before...
When you get an error like this: Invalid gemspec in [/opt/www/foo-project.makandra.de/shared/bundle/ruby/1.8/specifications/carrierwave-0.6.2.gemspec]: Illformed requirement ["# 1.1.4"] ... the machine's Rubygems needs to...
Consider this HTML: Even though the surrounding container defines a line-height, which vertically centers its inline elements, the check...
ActiveRecord has a feature called counter caching where the containing record in a has_many relationship caches the...
If you have issues with PDFs, fix them like this: pdftk .pdf output .pdf Background I had an issue where...
You probably already manage servers you often connect to inside the ~/.ssh/config file. What is nice: you may define alias...
...link_tag 'screen', :media => 'screen' %> These would be your two screen Sasses: # screen_with_pie.sass =pie behavior: url(/stylesheets/lib/PIE.htc) position: relative @import base.sass # screen.sass =pie // No pie for you @import base.sass
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...
...user@example.com'.split(/([@\.])/) => ["user", "@", "example", ".", "com"] Or, you can use a capture group with look-behind to keep them with the resulting substrings: >> 'user@example.com'.split(/(?<=[@\.])/) => ["user@", "example.", "com"] An example use...
Browsers usually cache website content in order to provide the user with faster responses. Examples are returning to a website...
Rubygems supports a 2FA for your account. Once enabled you need to provide your personal OTP code for every release...
...bug is fixed, you forget to take out that debug information. There is a better way. By copying one of the attached initializers into config/initializers, your forms will always render...
TLDR: When you put CSS rules into a partial and import that partial multiple times, the CSS rules will be...
I really love to use the shortcuts CTRL+Alt+ Arrow Left and CTRL+Alt+ Arrow Right to navigate through the...