...While there are ways around the interwebs that use the rubygems-update package and call its setup.rb, there is an undocumented switch you can use: gem update --system 1.3.7
...install bundler Successfully installed bundler-2.0.1 1 gem installed > bundle install Traceback (most recent call last): 2: from /home/henning/.rbenv/versions/2.5.1/bin/bundle:23:in ` ' 1: from /home/henning/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path' /home/henning/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb...
...which sets the updated_at timestamp to the current time. Unfortunately it also runs callbacks (and hence validations) on the receiving record, so it is unsuitable if you call it...
...to get a touch_gently method which updates updated_at, but does not run callbacks: User.find(5).touch_gently The initializer will also give you a method touch_all_gently
Every time you call $(...) jQuery will create a new object. Because of this, comparing two jQuery collections with == will never return true, even when they are wrapping the same native...
...dump any two-dimensional array to an Excel .xls spreadsheet with a single method call: table = [['user', 'email', 'hours']] User.all.each do |user| table << [user.name, user.email, user.hours] end table.dump_to_excel...
If a customer calls and tells you that she cannot see some content of her website beware of the following before starting tcpdump or other forensic debugging tools.
...when hooking tasks on cap deploy (see this article). Make sure to hook your calls properly when using this. To deploy an application and run all pending migrations before restarting...
...as its subject to someone@example.com. If you want it to contain a message body, call mail -s Test someone@example.com only; the mail application will then read your input from stdin...
...solution is to calculate the total count yourself and pass it to the pagination call: scope = User.complex_scope_full_of_includes total_number_of_users = scope.count @users = scope.paginate(:total_entries...
When you need to bulk rename files you can not call "mv *.foo *.bar" to change the extension of all .foo files to bar (because bash resolves wildcards and replaces...
...have no effect because of reasons. Instead, you need to know which class will call gets. For example: described_class.any_instance.stub(gets: 'user input') If you do not know where gets is...
...called, you can try something like this: Object.any_instance.stub(gets: 'user input') Any instance of an object should eventually hit that stub...
=height($height) height: $height line-height: floor($height / 2) * 2 So when you call +height(19px) in Sass this will be the resulting CSS: height: 19px line-height: 18px
...for the last time by a hypochondriac Nagios monitoring installation. If you are on-call long enough, you cultivate a violent reaction to the sound of your cell phone's...
set softtabstop=2 set shiftwidth=2 set expandtab You can also call those commands in a running Vim instance (using ":set ...") to switch on soft tabs temporarily...
...File.dirname(__FILE__) + '/../config/boot' (rdb:1) _ Enter c to continue and reach your actual debugger call. Then, debug away. If nothing happens for you: Make sure ruby-debug is available in...
...scalar values, since Array("foo") == ["foo"] Array(["foo", "bar"]) == ["foo", "bar"] But Array() actually calls to_a on its arguments, which may not always do what you expect. For example...
If you want to inspect the compiled code of your erb (or haml) templates, you can run the following code...
...ImageLoader.load('/my/image.png').then(function(image) { ... }); The image argument that is yielded to the promise callback is an HTMLImageElement. This is the kind of object you get when you call new...
...the alloted time CapybaraWrapper.default_max_wait_time = 0 # for we are a jealous gem
...# call block and retry if necessary and time allows ensure CapybaraWrapper.default_max_wait_time = old_wait...
end This means all patiently-calls that are nested within another patiently call are not patiently. They do never retry because the wait time for them is 0. It...
...a script/dbconsole -p, your MySQL shell will already be using UTF-8. When you call it yourself using mysql, it may not be enabled. You'll notice that when you...
...them over a Samba share onto your machine. From inside your Rails project directory call regularly: geordi remove-executable-flags Runs chmod -x on Ruby, HTML, CSS, image, Rake and...
...run multiple commands. In order to have all processing done in one mogrify system call, you'll need to define only one process that combines all options you'd like...
...the full path to you database dump like this: load-dump path/to/my.dump When you call load-dump without any arguments it will show a menu with all dumps in your...
...bundle exec if there is a Gemfile in the working directory, and run the call without Bundler otherwise. b spec spec This script is part of our geordi gem on...