$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

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...

...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...

rescue RestClient::ResourceNotFound => error @retries ||= 0 if @retries < @max_retries @retries += 1 retry else raise error end end response end This snippet tries to re-send the...

makandra Operations

Create a 1 GB file to swap to (we have sufficient space on / on this machine. Use a different partition if necessary) sudo dd if=/dev/zero of=/var/swapfile bs=1M...

If you prefer 2GB swap, chose count=2048, 4GB: count=4096 Change permissions of swap file: sudo chmod 0600 /var/swapfile Set up swap file and enable it:

...that Jasmine syntax has changed with Jasmine 2, so if you're using Jasmine 1.x you might instead want to use an older cheat sheet. Expectations # RSpec

# Only return nodes that are either elements or non-empty text nodes @nodeType == 1 || (@nodeType == 3 && _.strip(@nodeValue) != '') ).last() if $lastContent.get(0) == $lastChild.get(0) findLastLeaf($lastChild) else $container

...states = Array.wrap(state_or_states).map(&:to_s) state_or_states = state_or_states.first if state_or_states.size == 1 { :conditions => { :state => state_or_states...

...the blank form on top with the following snippet: actors = movie.actors actors.build actors.unshift(actors.pop(1)) # won't work with Rails 4+ Because build_for_form creates new objects and appends...

If you use Angular 1.4+ together with Angular Animate, all ng-show, ng-hide, ng-class etc. are animated on default. If you want only some elements to be animated...

...enable animations globally and add a certain class if no animation is wanted. Option 1: Enable animations only for html elements with class 'animate' @app.config ['$animateProvider', ($animateProvider) -> $animateProvider.classNameFilter(/\banimate\b...

...using in_groups_of and writing multiple column sets of your data (i.e. split 1 block of 3 columns and 100000 rows into 4 blocks of 3 (12 in total...

...use jasmine.any(Klass): describe('plus()', function() { it ('returns a number', function() { let result = plus(1, 2) expect(result).toEqual(jasmine.any(Number)) }) }) Also see Expecting objects as method invocation arguments...

...install the last supported version of Bundler for Ruby < 2.3: gem install bundler -v '~>1' You will also see an error if your RubyGems version is...

After my update from MacOS X 10.6 Snow Leopard to 10.7 Lion the search function in Apple Mail stopped working. There were no or too little search results, when I...

...After the rebuild you should get the right search results again. Proceed with Step 1-2 for all your mailboxes (also for every top-level folder that is stored under...

...enable this, add an initializer config/initializers/array_paginate.rb: require 'will_paginate/array' You can now say: > numbers = (1..1000).to_a > page = numbers.paginate(:page => 2, :per_page => 10) => [11, 12, 13, 14, 15...

...16, 17, 18, 19, 20] > page.total_entries

...ID and title of the Pivotal Tracker story you're working on. For example: [#12345] Add Google Maps to user profiles Optional further commit messages in the body