UI sortable helps reordering items with drag 'n drop. It works quite fine. Proven configuration for sorting table rows When invoking the plugin, you may pass several options. This set...
...causing the thead border-bottom to grow // when the first table row is dragged tr.ui-sortable-helper:first-child + tr > td border-top: none
You can use JavaScript to get or set cookie values on the client. Using the vanilla JavaScript API In JavaScript, document.cookie is an accessor to all cookies on the current...
...site. It looks like a String, but its setter is actually more powerful. When setting cookies this way, remember to set the path=/ option. Reading cookies A result may look...
Our old solution for cronjobs, the "craken" plugin, is no longer maintained and does not work on Rails 3.2+. We will instead use the whenever gem. "Whenever" works just like...
...craken", by putting your rake tasks into the server's cron table. Everything seems to work just like we need it. Installation for new projects Add "whenever" to your Gemfile...
...an array, neither JavaScript/ES6+ nor libraries like LoDash offet that natively. Here is a simple function instead that modifies the input array in place. function moveArrayElement(array, element, offset) {
...It was what I needed, but you could easily adjust that. Check the linked StackOverflow post for more information and other implementations...
...Basic.encode_credentials for that, and put its result into the Authorization request header. Request specs For request specs, use the :header option. it 'requires authentication' do get '/' expect(response.status).to...
...username, password) get '/', header: { Authorization: encoded_credentials } expect(response.status).to eq(200) end Controller specs In controller specs, you can put then into request.env['Authorization']. it 'requires authentication' do
...inherited methods but call the parent's implementation, too. In JavaScript, there is no simple "super" method like in Ruby -- so here is how to do it with Backbone.
...own initialize method, and you'd get this console output: Hello World. How to super But we want initialize of BaseClass to run as well -- and if you want to...
Suppose you want to implement a publish/subscribe pattern in your Frontend application to react to data changes and events. First, you might be looking for an event emitter library.
Expiration of Rails sessions By default Rails sessions expire when the user closes her browser window. To change this edit your config/initializers/session_store.rb like this: ActionController::Base.session = { :key => '...', :secret => '...' :expire_after...
} In older Railses the initializer is not available. Set the option in the environment.rb instead: config.action_controller.session = { :key => '...', :secret => '...' :expire_after => 10.years } Expiration of Rails cookies In addition to the...
So I had the issue that User input (coming from many different sources and users) often contains the same long word. Maybe that's a super german thing...
...compiler that crawls the document and replaces all occurencies of certain word and puts a soft-hyphen (­, or \xAD) where i want the word to break. This is only...
Moved from Less to Sass. Bootstrap now compiles faster than ever thanks to Libsass, and we join an increasingly large community of Sass developers. Improved grid system...
...added a new grid tier to better target mobile devices and completely overhauled our semantic mixins. Opt-in flexbox support is here. The future is now—switch a boolean variable...
...wanted bundle update some_gem What is wrong Let's say your Gemfile asks for some-gem which you can see when running gem list but bundle show some-gem...
...just gives you an error: Could not find gem 'some-gem', in any of the sources Another indicator: Doing a bundle install --local breaks and bundle install installs every gem...
...you need to do it yourself. It's not that hard: Get more disk space Add an extra virtual hard disk to the machine with the disk size you want...
...the CD, open a terminal (on the guest, not the host!) and become root: sudo su fdisk -l to see the disk information. \ There should be one drive with some...
The Interactive Advertising Bureau (IAB) is a European marketing association which has introduced a standard how advertising can be served to users in line with the General Data Protection Regulation...
...GDPR). This standard is called the TCF 2.0 (Transparency and Consent Framework). If you want to integrate any kind of advertising into a website, chances are the advertising network will...
Spreewald gives you the within meta step that will constrain page inspection to a given scope. Unfortunately, this does not work with RSS feeds, as they're XML documents and...
...re inspecting XML that is invalid in HTML, you need to inspect the page source instead of the DOM. You may use Spreewald's "... in the HTML" meta step, or...
...and extract it:\ tar xvfz rubygems-1.3.7.tgz If you previously had RubyGems installed via apt: \ sudo apt-get remove rubygems Install RubyGems:\ cd rubygems-1.3.7 && sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem If gem list does not show all gems you previously had, you can create a symlink to your old gem directory:\ cd /usr/local/lib/ruby && sudo...
...Consider this HTML: Hello World Lorem ipsum... Hello Universe Lorem ipsum... Now let's say you obtain a list of all such message containers as an array: messages = page.all('.message...
messages[0].find('h2', :text => 'Hello World').text => "Hello World" Now we search inside the same container as above, which contains "Hello World" as its headline. \
...all for laying out your HTML emails. Email client HTML rendering is way more scattered than browser HTML. While you might have a pretty good understanding of what features and...
...patterns you can use to support all major browsers, I doubt anyone masters this craft for HTML email clients. The only way to ensure your email looks good (acceptable, at...
Most of the JavaScript snippets have code that manipulates the DOM. For that reason dom manipulating javascript code should have been executed after the DOM has loaded completely. That means...
...above would have the advantage not to pollute the global scope and to reduce unexpected side-effects...
...t requested an action for a while. Note that this is different from deleting sessions some time after the last login, which is the default. Also note that this is...
...probably a bad idea. Most sites keep sessions alive forever because having to sign in again and again is quite inconvenient for users and makes your conversion rates go down...
...a great jQuery library to make (large) fields more usable. For Bootstrap 3 there is select2-bootstrap-theme. It won't work for Bootstrap 4, but rchavik's fork does...
...if you have some. @import ~bootstrap/scss/bootstrap/variables @import ~bootstrap/scss/bootstrap/mixins @import ~font-awesome/scss/font-awesome @import ~select2/src/scss/core @import ~select2-bootstrap-theme/src/select2-bootstrap4.vars @import ~select2-bootstrap-theme/src/select2-bootstrap @import ~select2-bootstrap-theme/src/select2-bootstrap4.after
...gem 'cucumber_factory' Run bundle update on any added/changed gem, e.g. bundle update cucumber capybara selenium-webdriver database_cleaner cucumber_spinner Error messages & solutions uninitialized constant JSON -> Add gem 'json...
...to your Gemfile uninitialized constant Selenium -> Add gem 'selenium-webdriver' to your Gemfile Failing Cucumber steps that use find Capybara 1's #find method raises an error if nothing could...
...provides you some methods that help you to write readable and understandable method chains. See yourself: Example // before $('.some').show().children().doThat(); window.setTimeout(function(){ $('some').children().doSomething().hide(function() { window.setTimeout...
otherStuffToDo(); }, 1000); }); }, 500); // after $('.some').show().children().doThat() .wait(500) .doSomething().hide() . wait(1000) . otherStuffToDo(); jquery-timing transformed the setTimeout callback into a chainable method. Now the code is...
...give you the =~ matcher: actual_array.should =~ expected_array Rspec 3 With RSpec 3's expect syntax you can choose one of these two matchers: expect(actual_array).to match_array...
...but contain_exactly takes a list of elements as varargs. Test::Unit If you install shoulda-matchers you can say: assert_same_elements([:a, :b, :c], [:c, :a, :b])
jQuery offers many different methods to move a selection through the DOM tree. These are the most important: $element.find(selector) Get the descendants of each element in the current set...
...of matched elements, filtered by a selector. Does not find the current element, even it matches. If you wanted to do that, you need to write $element.find(selector).addBack(selector...