...clean bundler environment and without spring. def run(cmd, timeout = nil) ENV['DISABLE_SPRING'] = '1' Bundler.with_clean_env { super } end end World(Customization) We're also disabling Spring because it...

1. Sometimes you have search entries in the autocomplete of the address bar, which are higher weighted than your bookmarks. Pressing SHIFT + DEL while searching removes them from the history...

...a key for your encrypted harddisk: dd if=/dev/random of=/home/bob/keyfile_sdb1 bs=4096 count=1 Then add your keyfile to encrypted harddisk: How to change your dm-crypt passphrase (step...

...not really what you are looking for: isNaN(NaN) // true isNaN('hello') // true Option 1: ES6 The Object.is() method determines whether two values are the same value. It even works...

full_path = File.expand_path attachment # find id to update id = full_path.match(/(\d+)\/original\/.+$/)[1] puts "Re-saving ##{id}..." your_model = YOURMODEL.find(id) # Paperclip will re-save the attachment using...

Note: This applies to plain Ruby scripts, Rails does not have this issue. When you work with Ruby strings, those...

makandra dev

...c copy part2.webm # Create a textual list of all sequences for i in {1..2}; do echo "file 'part$i.webm'" >> parts.txt; done # Combine the ffmpeg -f concat -safe 0 -i...

makandra dev

globstar off In that case, ** behaves just like * and will match exactly 1 directory level. $ ls spec/**/*_spec.rb spec/models/user_spec.rb To enable it, run shopt -s globstar

makandra dev
tldp.org

...the linked article.) Basic 0/1/2 references stdin/stdout/stderr >/2> redirects stdout/stderr, where > is taken as 1> &1/&2 references stdout/stderr &> redirects stdout and stderr = everything (caution: see below) Caution: &> is functional...

...when redirecting output in Ruby scripts. Instead of cmd &> file, prefer cmd > file 2>&1, which equals: "Redirect stdout of cmd to file, and redirect stderr just where stdout is...

...versions no longer include the ActiveRecord adapter (which is part of ActiveRecord since Rails .1). So your Gemfile should say:

...will return a list of their IDs: User.last.collect_ids # => [9] [User.first, User.last].collect_ids # => [1, 9] User.active.collect_ids # => [4, 5, 6] [4, 5, 6].collect_ids # => [4, 5, 6]

redis.io

...reproduced (like cached values). If you store data that you want to keep for 1 year or so, you must keep in mind that this data may disappear sooner.

Enable ip traffic forwarding: Open /etc/sysctl.conf Uncomment the line net.ipv4.ip_forward=1 Reload using sudo sysctl -p /etc/sysctl.conf Reconfigure ip_tables to allow NAT: Download the attached...

$helper.prependTo('body').text('click me').css({ zIndex: 9999, position: 'absolute' }); setTimeout(function() { $helper.remove() }, 1000); JAVASCRIPT find("##{id}").click Note that the link tag is removed after 1 second. You...

...application details. Consider the following: ActiveRecord::RecordNotFound: Couldn't find Organisation::Membership with 'id'=12 [WHERE "organisation_memberships"."user_id" = 1] You should probably not simply render those error messages...

...issue but it turns crazy if you try to include associated models deeper than 1 level: options = params.merge(:include => { :user => :avatar }) Post.paginate options When inspecting the merged params you will...

...I've got this message because the RAM Quota was exceed: 2013-11-11 17:13:25 WARNING nova.compute.api [req-bdasdfas-f5d7-4fcd-bf1b-asdfasdf229e ba2c21dadasdfasdf1d6asdfasdfa0f bfe2db2aasdfasdfb8ea686asdfasdfb] Quota exceeded for...

...bfe2db2aasdfasdfb8ea686asdfasdfb, tried to run 1 instances. Cannot run any more instances of this type. 2013-11-11 17:13:25 INFO nova.api.openstack.wsgi [req-bd003113-f5d7-4fcd-bf1b-asdfasdf229e ba2c21dadasdfasdf1d6asdfasdfa0f bfe2db2aasdfasdfb8ea686asdfasdfb...

comment = Comment.build(title: 'Bikini Bottom', content: 'Burgers for free', user_id: 1) comment.valid? => true comment.save => ActiveRecord::InvalidForeignKey Exception

...Promises/A+ compatible implementations like native promises, jQuery 3+ deferreds or Bluebird. Deferreds in jQuery 1 and 2 do not have this behavior. Read more Promise-based functions should not throw...

github.com

>> JSON.parse(json) JSON::ParserError: 757: unexpected token at '"foo"' from /.../gems/json-1.7.7/lib/json/common.rb:155:in `parse' from /.../gems/json-1.7.7/lib/json/common.rb:155:in `parse' from (irb):1 Why? The error above happens...

...Linux will only use swap if *no* other memory is available sudo sysctl vm.swappiness 1 # Linux will try to avoid swap whenever possible The default value of the swappiness parameter...

There are many fun Unicode characters like ▲ or ☯. You might be tempted to use them for graphical elements in lieu...

...load a User and change both its group and its group_id: user = User.find(1) user.group = Group.find(3) user.group # returns # user.group_id = 4 user.group_id # returns 4 user.save

makandra dev
github.com

...highlights in a Google Groups post that the release is not backwards compatible to 1.x versions of Capybara does not support Ruby 1.8.x anymore removes confusion with Rails...