...ujs will not set CSRF headers. This is by design and improves security. In order to send those headers for specific hosts, add this piece of CoffeeScript directly after jQuery...

Browsers usually cache website content in order to provide the user with faster responses. Examples are returning to a website using the "Back" button, or reopening a browser and restoring...

...may display an outdated list. In these cases, client caching should be disabled. In order to prevent client caching, set a Cache-Control header of no-store. This tells the...

makandra dev

In order to monitor a Rake task using God your Rake file must write a file with its process ID (PID) to a path determined by God. This way God...

...might have noticed that JS and CSS are not cached by all browsers. In order to force Apache to add expiry dates to its response, add the attached .htaccess to...

When the order matters: expect(array1).toEqual(array2) Regardless of order: expect(array1).toEqual(jasmine.arrayWithExactContents(array2)) Ignoring extra elements: expect(array1).toEqual(jasmine.arrayContaining(array2...

...that the mysqladmin-command is used to check if the server is running in order to rotate the log: # vim /etc/logrotate.d/mysql-server /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log { daily rotate 7 missingok create...

...or Rack::SteadyETag). Those middlewares usually want to capture the entire response body in order to generate the ETag based on its contents. If they do that, you won't...

...reverse_order does not work with complex sorting constraints and may even silently create malformed SQL for rails < 5. Take a look at this query which orders by the maximum...

...GREATEST(pages.published_from_de, pages.published_from_en) DESC').to_sql # => SELECT "pages".* FROM "pages" ORDER BY GREATEST(pages.published_from_de, pages.published_from_en) DESC Rails 4 Rails 4 will not...

...user tables without changing existing passwords Use salts to disarm brute force attacks. In order to let users keep their passwords, hash passwords as before, then hash the result again...

wiki.postgresql.org

...nspname NOT IN ('pg_catalog', 'information_schema') AND C.relkind <> 'i' AND nspname !~ '^pg_toast' ORDER BY pg_total_relation_size(C.oid) DESC LIMIT 5; Example output: relation | total_size ----------------------+------------ public.snapshots...

127.0.0.1:6379[1]> KEYS * [possibly long output or "empty list or set"] In order to delete the keys you need to select the DB first and then remove all...

...UTC). Actually, you cannot "turn off" time zones, just try to ignore them. In order to disable time zone conversion in Rails 2, open config/environment.rb and comment or remove the...

...config.time_zone line: # config.time_zone = 'Berlin' In order to disable time zone conversion in Rails 3 or newer, open config/application.rb and add the following: config.active_record.default_timezone = :local config.active_record.time_zone_aware...

...value or UTF-8 codepoint) can be done in different ways in Ruby: String#ord or String#unpack to get character values Integer#chr or Array#pack to convert character...

...asterisk (*) is required for strings longer than 1 character. Strings to character values String#ord To convert back from a String to its codepoint, use String#ord:

...its name as table#name, table.name or #name_table. Extra columns are ignored, column order does not matter, whereas row order does. Then /^I should see the following ([\w]+) table...

Looks for table#name. Expects columns and rows to be in the given order, but ignores extra rows and columns. Only looks at one row at once, so does...

...in the project before, starting many thousand of jobs might reveal unexpected issues: Wrong order of sidekiq queues: Your queue might block the whole application and monitoring. Monitoring or mailer...

stackoverflow.com

...you are on MySQL ≥ 5.1.7, do this instead: SELECT * FROM information_schema.processlist WHERE command != 'Sleep' ORDER BY id; That also allows you to only show some values or order differently, like...

SELECT user, time, state, info FROM information_schema.processlist WHERE command != 'Sleep' ORDER BY time DESC, id; One more example -- see all non-sleeping queries that take some time, for example...

makandra dev
stackoverflow.com

field.ancestor('div.form-group') Both versions will return the outermost matching element. Use the #order option find the closest parent: field.ancestor('div.form-group', order: :reverse...

...when parsing your HTML string. As long as tags are closing in the correct order, you should be fine. However, when converting back to an HTML string, you may end...

...information embedded into font files is usually very bad, especially for unexpensive fonts. In order to remedy this, Linux and MacOS ignore hinting information in font files and replace it...

...information. Now use ttfautohint to generate an autohinted TTF font: ttfautohint myfont.ttf myfont_autohinted.ttf In order to support all desktop browsers, we need to offer one other font format, EOT. You...

When paginating records, we usually need to know the number of total records in order to render pagination links. Popular pagination libraries like will_paginate or Kaminari do this for...

...Here is the list of features we want to achieve: Paginated (using will_paginate) Ordered by translated name of departure_place and arrival_place No N+1 queries

...normally straightforward, but as we are referencing the table we want to order on twice some adjustments need to be made. Ride .joins('inner join places as departure_places on...

docs.gitlab.com

Use rules to include or exclude jobs in pipelines. Rules are evaluated in order until the first match. When a match is found, the job is either included or excluded...

makandracards.com

In order to have more human readable git branches, do git pull --rebase To always pull like this, write these lines to your ~/.gitconfig: [pull] rebase = true

...in the subdirectory controllers/users/sign_ups_controller.rb, but there has to be a SignUpsController in controllers/sign_ups_controller.rb in order to make the second example work. You can alter this behaviour with a custom controller...

end resources :projects, only: :show Note that the routes must appear in this order so projects/report won't match the :projects resource. Run rake routes and you get what...