skorks.com

...that mindlessly!) !$ Access the last argument of the previous command. Example: Check with "ls foo*" first and call "mv !$ /tmp" afterwards. Combined commands Ctrl + (C P O) Cancel the running...

...need to do it yourself, for example by using collect_hash: my_keys = %w[ foo bar baz ] my_cookies = my_keys.collect_hash { |key| [ key, cookies[key...

...name', :dir => 'asc' } ) you can fix this by using params.merge {:my_param_to_overwrite => 'foo' }. To fix the example above the code could look like: url_for( params.merge { :order => 'name...

Back in the old days, we couldn't do something like that: .foo { position: absolute; bottom: 0; /* This was bad: */ left: 10px; right: 10px; } Why? Because IE5 and IE6 (which...

...in-place batch processing with plain ruby? The following script will in-place replace "foo" with "bar" in all files you feed it. Call it with ./my_script path/to/my/files/*

The step definition below lets you write: When I click on "Foo" This is useful in Selenium features where the element you click on is not necessarily a link or...

...an unsafe string to get the escaping love from Rails: embed = javascript_tag('var foo = 1337;') # This is an html_safe SafeBuffer embed.to_str # This is a plain, unsafe String

The step definition below lets you say: Then I should see the text "foo" You should not look too closely at the step definition because when you see the...

...step definition below allows you to write: Then I should see a link labeled "Foo" But I should not see a link labeled "Bar" Webrat Then /^I should( not)? see...

tutorialzine.com

...from the current page (as any tag would do): var parser = document.createElement('a'); parser.href = 'foo'; // set the URL you want to parse (resolving relative paths in the context of the...

...within but prefer the attached "inside any" Cucumber steps like these: When I follow "Foo" inside any "table" Then I should see "Bar" inside any "li...

...You can use Object#method to obtain a method reference that responds to #call: foo_plus = "foo".method(:+) foo_plus.call("bar") # => "foobar" The method reference also understands #to_proc so you...

...quote attribute values or you will get a Nokogiri parsing error like this: unexpected 'foo' after 'equal' (Nokogiri::CSS::SyntaxError...

makandracards.com

The step we used in the past (Then "foo" should not be visibile) doesn't reliably work in Selenium features. I overhauled the entire step so it uses Javascript to...

makandra dev

...before the # character (but newline is allowed) <%# this works as expected %> <% # this works, too # foo bar baz...

Give your iframe a name attribute (i.e. ) and then simply use When I press "Foo" in the iframe "myframe" Then I should see "Bar!" in the iframe "myframe"

...the beginning and end of a word instead: SELECT * FROM notes WHERE title REGEXP "[[:<:]]foo[[:>:]]" These markers are unique to MySQL and not available in Ruby regular expressions...

...in slug generator since Rails 2.2: > "What Up Dog".parameterize => "what-up-dog" > "foo/bar".parameterize => "foo-bar" > "äöüß".parameterize => "aouss" Also see: Normalize characters in Ruby...

...Capybara.ignore_hidden_elements = false # find all elements (hidden or visible) page.all(".articles .article[id='foo']") # find visible elements only (overwrite the standard behavior just for this query) page.all(".articles .article...

...id='foo']", :visible => true) # changing the default behavior (e.g. in your features/support/env.rb file) Capybara.ignore_hidden_elements = true # now the query just finds visible nodes by default page.all(".articles .article[id...

How to define and call class methods in CoffeeScript classes: class Foo @classMethod: -> @otherClassMethod() instanceMethod: -> @otherInstanceMethod() @constructor.classMethod...

xip.io

10.0.0.1.xip.io resolves to 10.0.0.1 www.10.0.0.1.xip.io resolves to 10.0.0.1 mysite.10.0.0.1.xip.io resolves to 10.0.0.1 foo.bar.10.0.0.1.xip.io resolves to 10.0.0.1 ...and so on. You can use these domains to access virtual hosts...

makandra dev

...whole libvirtd service. But you can just reload corresponding domain xml too: $ virsh define foo.xml

...attribute on it, but then don't attach it to the DOM: $element = $(' '); $element.data('foo', 'bar'); After the last line in the code sample above, $element can no longer be...

A workaround is to use grep with find: find ./ -type f -exec grep "foo...