...you have files in your .gitignore they won't be considered for changes, but still you might want to get rid of them, e.g. because they clutter your file system...
...While a regular git clean will ignore them as well, passing the -x switch changes that: git clean -x If you want to see what would happen first, make sure...
...warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated. Specify all the necessary parameters instead. that is for example caused by url_for( :overwrite_params...
...link_to uses url_for internally, so you can can use params.merge {...
...} as the second parameter of link_to...
Stop MySQL: sudo service mysql stop Move (or copy) your mysql directory. If you want /mnt/mysql to be the new directory, do it like this:
.../var/lib/mysql /mnt/ Open your MySQL configuration (sudo vim /etc/mysql/my.cnf) and change the datadir value to your new path (e.g. /mnt/mysql) Modify your AppArmor configuration: sudo vim /etc/apparmor.d/usr.sbin.mysqld Change/copy the lines...
PostgreSQL supports the SQL OVERLAPS operator. You can use it to test if two date ranges overlap: => SELECT ('2001-02-16'::date, '2001-12-21'::date) OVERLAPS...
overlaps -------- true An important caveat is that the date ranges are defined as start <= time < end. As such the later date is not included in the range:
When your Solr seems to be started properly (a process is running with the correct data directory) but never responds properly and replies (via the API or web interface) with...
... check if Solr's log directory is actually writable for the user running it...
Never use raise_error without specifying the Error you expect. expect { do_a_lot_of_complicated_stuff }.to raise_error will be green if you make any error in programming...
...E.g. a simple typo would make the test above green. The block will catch the Spec:: exception and the test will be happy. Be sure to always have custom errors...
If you have trouble updating something on FreeBSD you should always take a look in the UPDATING file. For this error there is this solution which worked perfectly for me...
...There was a nasty bug introduced in the update below, it was introduced in svn revision 373476 and corrected in 373485. If you get errors looking like this one: ===> Registering...
While RSpec 1 and 2 decided that specs inside spec/model are model specs, and those inside spec/features are feature specs (and so on), RSpec 3 will no longer do that...
...such as missing routing helpers, etc. There are 2 ways to fix this: Explicitly set the type on each spec. For example: describe '...', type: 'feature' do # ... end
AuthExternal pwauth Require group admin You need to first install libapache2-mod-auth-sys-group. You don't get any error message if you haven't installed it but...
...it doesn't work. sudo apt-get install libapache2-mod-auth-sys-group
Since Rails 5, domain models inherit from ApplicationRecord by default. This is the place to put code that should be available in all your application's models.
Great presentation about writing Javascript like you write everything else: Well-structured and tested. JavaScript is no longer a toy language. Many of our applications can’t function without it...
...the same practices we use with real languages. This framework agnostic talk takes a serious look at how we develop JavaScript applications. Despite its prototypical nature, good object-oriented programming...
...t!. They will raise I18n::MissingTranslationData on a missing translation instead of printing a string like translation missing: de.custom.failure. To turn on raising globally, you need to replace the default...
Sometimes it might be helpful to have a version history for a gem, e.g. when you want to see if there is a newer Rails 2 version of your currently...
At first you should search your gem at RubyGems. Example: will_paginate version history. The "Tags" tab at GitHub might be helpful as well...
Use this MySQL command to show further info about a table: SHOW CREATE TABLE tags; This will output a table schema like this: CREATE TABLE `tags` ( `id` int(11) NOT...
...records of a Ruby on Rails ActiveRecord model to be organised as a tree structure (or hierarchy). It uses a single, intuitively formatted database column, using a variation on the...
...materialised path pattern. It exposes all the standard tree structure relations (ancestors, parent, root, children, siblings, descendants) and all of them can be fetched in a single sql query. Additional...
So you want to know if you are on natty, precise, quantal, or something else? Check /etc/lsb-release. $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION...
...of pain like me, you can get to Xfce's native window manager by saying: xfwm4 --replace
...you are done and all is well: remember to remove those entries again, or set the log level to 0, to switch off rewrite logging...
When you want to find out the data type of an attribute, you can just use ActiveRecord's columns_hash...
...order to open a Nautilus window in your terminal's working directory, you can say:
If you use Tempfile and pass your own filename containing an extension, it will just be consumed by the Tempfile...
WebRTC HTTP/2 is here, let’s optimize! or, why (some) yesterday's best-practices are today's HTTP/2 anti-patterns...
...there was a blog post entitled “What the Hell is Happening to Rails” that stayed at the number one spot on Hacker News for quite a while. The post and...
...many (but not most) the comments on the post reflect deep-seated concern about the recent direction of Rails. Others have addressed the core question about change in the framework...
Rails 3.0 has been underway for a good two years, so it’s with immense pleasure that we can declare...