...being used by default (which may be annoying). Here is how to do that. Beware: By following the steps below, you will drop and recreate your cluster. You will lose...
...As an example, we will be modifying 9.5 main (running on port 5435) below. Become a PostgreSQL superuser sudo su postgres Backup entire database pg_dumpall -p 5435 > 5435.sql
Sometimes, the rails dev server doesn't terminate properly. This can for example happen when the dev server runs in...
When such a virtual attribute should contain integer values you might get unexpected behavior with forms, because every param is a string and you don't get the magic...
...guest from 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...
The cards editor has a feature "Cite other card" to create links to other cards in the same deck as...
After upgrading to Rails 6.1.7.2 one of our apps printed a wall of warnings while booting: /var/www/app/shared/bundle/ruby/2.6.0/gems/net-protocol-0.2.1/lib/net/protocol.rb:68: warning: already...
ActiveRecord provides the ids method to pluck ids from a scope, but what if you need to pluck Global IDs...
When logging in Rails, you can use the log_tags configuration option to add extra information to each line, like...
Capybara gives you two different methods for executing Javascript: page.evaluate_script("$('input').focus()") page.execute_script("$('input').focus()")
This note describes how to kick a user out of a Rails application after she hasn't requested an action...
tl;dr: Use event.currentTarget unless you are absolutely certain that you need event.target. Since it hasn't been written down...
...iterated until the final design is ready – shiny, accepted and ready for implementation. I believe this works well when you get to work with the final decider in person.
We forked trusty memoizer to make two changes: Memoized methods now preserve their arity. Previously all memoized methods had an...
...should see the following ([\w]+) table:?$/ do |name, expected_table| name = name.underscore table_element = begin element_at("table\##{name}") rescue Webrat::NotFoundError begin element_at("table.#{name}") rescue element_at...
When using the asset pipeline your assets (images, javascripts, stylesheets, fonts) live in folders inside app: app/assets/fonts app/assets/images...
...export_path = Dir.mktmpdir('exports') # ... ensure FileUtils.remove_entry(export_path) end Option 3: Using a before/after block before { @export_path = Dir.mktmpdir('exports') } after do if @export_path.present? FileUtils.remove_entry(@export_path)
...switches to the clicked link. In a Jasmine spec I wanted to test this behaviour. Unpoly's up.hello emits an up:fragment:inserted event, in whose callback function I can...
On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and...
...a "add new user" forms. Chrome developers say this is by design as they believe it encourages users to store more complex passwords. Recommended fix for Chrome and Firefox
Capybara allows you to select DOM elements, e.g. by using field, find_field(...) or field_labeled(...): role_select = field_labeled...
...to name any file @imported by SASS with a leading underscore. SASS files not beginning with an underscore will be rendered on their own, which will fail if they are...
...a lot more, you can think of it as a "Browserstack for mail clients". Best practices Use tables for layouting. Use these HTML attributes: align="center", width="100%", valign="top...
...In a second tab, open a preview of your designed HTML mail. It's best to take it from Staging, so that assets (images!) will be available to litmus during...
const wordBreaks = { 'Fahrsicherheitstraining': "Fahr\xADsicherheits\xADtraining", 'Fahrsicherheitszentrum': 'Fahr\xADsicherheits\xADzentrum', 'Kreisverkehrswacht': 'Kreis\xADverkehrswacht', 'Berufsgenossenschaft': 'Berufs\xADgenossenschaft', } const keys = Object.keys(wordBreaks) function textNodes(node){ let textNodes = [] let walk = document.createTreeWalker(node...
...get rather expensive and doing it for every long word does not make it better, but in my case the pages are not very content-heavy and there is no...
When deploying code with Capistrano (depending on your configuration) at some point Capistrano tries to check out code from your...