$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
...the project access token Example configuration for the project manager with two submodules customer_1 and customer_2: image: name: "example.com/manager/ci:v1" before_script: # git clone without --recursive already happend...
>> 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
...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...
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...
...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
...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...
# 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...
j and k to navigate in the diff u again to stage/unstage chunks 1 to stage/unstage only lines \ to split large chunks F5 to refresh the view
...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
Assuming you're wanting to undo the effects of git rm or rm followed by git add -A or something...