Skip to content

Instantly share code, notes, and snippets.

View triskweline's full-sized avatar

Henning Koch triskweline

View GitHub Profile
@triskweline
triskweline / jquery_shuffle_children.js
Created November 15, 2018 08:44 — forked from joseluisq/jquery_shuffle_children.js
Shuffle child elements with jQuery
jQuery.fn.shuffleChildren = function(){
var p = this[0];
for (var i = p.children.length; i >= 0; i--) {
p.appendChild(p.children[Math.random() * i | 0]);
}
};
# Copy this to features/support/ssl_fix.rb to make Capybara work with sites that switch between HTTP and HTTPS
module Capybara::Driver::RackTest::SslFix
[:get, :post, :put, :delete].each do |method|
define_method method do |*args|
args[0] = path_to_ssl_aware_url(args[0])
super(*args)
end
end