The Rails community has been abuzz with object-oriented programming, SOLID principles, laws, design patterns, and other principles, practices, and patterns. We’ve (re)discovered new tools and techniques to separate and reuse logic, making code easier to test, understand, and maintain. Now that we’ve learned about all these new tools, when do we use them?
This sounds promising:
The best part from the Rails side, is that you don’t have to change anything at all in your code to swap a varchar out for an ENUM.
ActiveSupport >= 3 has
Date.parse('2011-02-10').beginning_of_quarter #=> 2011-01-01 Date.parse('2011-02-10').end_of_quarter #=> 2011-03-31
You can manually calculate the quarter index like
(Date.parse('2011-02-10').month / 3.0).ceil #=> 3
SELECT QUARTER('2011-02-10'); #=> 1
If you upgrade to the mysql2 gem, you will run into the problem that the server's database.yml (which is usually not under version control) needs to change exactly on deploy.
You can however make your database.yml work for mysql and mysql2 at the same time. Simpy do this
production: adapter: <%= defined?(Mysql2) ? 'mysql2' : 'mysql' %> #...
Introspect the Ruby Heap by indexing, counting, locating references to and detaching (in order to release) objects.
A collection of inspirational websites using media queries and responsive web design. Curated by Eivind Uggedal (@uggedal).
Upgade to LibreOffice 3.5.3+ or disable hardware accelleration in Tools → Options → LibreOffice → View → Graphic output.
To have your text input field pre-filled in with some text that disappears as soon as the user selects it, use the attribute
<input type="text" placeholder="User name here">
This will only work in recent browsers (IE >= 10, FF >= 4, Chrome >= 4, Safari >= 5, Opera >= 11.6).
Generated animations are free to use without backlink obligations…
… WITH THE EXCEPTION of any other animated images generator applications
Last week saw a security issue with rails 2.3 that required a fix. While an official patch was provided, the 2.3 branch is no longer maintained. So we forked it.
(I'm sure there are already 100 other forks doing absolutely the same, but they are not very easily discoverable.)
To use our fork, change the
gem "rails"... line in your Gemfile to this:
gem 'rails', :git => 'https://github.com/makandra/rails.git', :branch => '2-3-fixes'
The intent is to make as few changes to the f…
If you have a file that looks like a precompilation fingerprint, the Rails asset pipeline will not see it. So don't have filenames like this:
The linked article describes how to use a Firefox addon "Flash-Aid" to install a better build of Flash and apply some optimizations.
With this I can now properly watch fullscreen HD videos under Ubuntu.
New way to install an actual puppet version on ubuntu
On case-insensitive file systems like Mac's HFS+ (per default – you may change this, but it won't work for all programs), git won't recognize when you change the casing of files in your repository.
git mv -f oldfile.name Oldfile.name
Promises unified window for all chat conversations, better call quality.
Upgrade seems to work fine. If you installed your old skype from a Ubuntu repository, you need to remove it first using:
sudo apt-get remove skype
Then simply install the
.deb from the official page. You won't lose any settings.
amounthelper now retrieves the decimal separator from your I18n dictionary (
number.format.separator) instead of hardcoding it to a comma.
money_amounthelper tunnels options to
This script loads a dump into your development database.
You can provide the full path to you database dump like this:
When you call
load-dump without any arguments it will show a menu with all dumps in your
This script is part of our geordi gem on github.