...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...

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...

...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...

...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...

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...

...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...

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...

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...

makandra dev

...after pagination: # does not work @contracts = @contracts.reject {...} # works @contracts.reject! {...} YAML fixes Change # old date: order: [ :day, :month, :year ] # new date: order: - :year - :month - :day Also see Upgrade from Ruby...

...necessarily) only happen when trying to update or otherwise lock several rows in different order. Solving deadlocks is potentially complicated, so here are a few pointers: MySQL should always detect...

...existing rows with ascending numbers. Furthermore these numbers should be generated by a special order. In order to achieve that you could do the following: execute "SET @pos := 0;"

...UPDATE pages SET position = ( SELECT @pos := @pos + 1 ) ORDER BY updated_at DESC...

makandra dev

...special tag message" A normal git push will not push the tag. So in order to publish your (local) tags, you have to git push --tags Check if a tag...

...Many times you would use scope options, like this: users = User.scoped( :joins => 'INNER JOIN orders joined_orders ON users.id = joined_orders.user_id', :conditions => [ 'joined_orders.date BETWEEN ? AND ?', start_date, end_date ],

...user IDs by selecting only from the users table: users = User.scoped( :joins => 'INNER JOIN orders joined_orders ON users.id = joined_orders.user_id', :conditions => [ 'joined_orders.date BETWEEN ? AND ?', start_date, end_date ],

...t magically load themselves from disk. Production All files are loaded in a deterministic order once the server boots. Take this example with some constants referencing each other: # app/models/contract/document/uploader.rb

...Document::Uploader. In development this can happen randomly, as you never know in which order the files are autoloaded. If the autoload mechanism has already loaded app/models/document/uploader.rb, a constant lookup...

...by default (see official Documentation). However, it only cleans up releases, not assets. In order to clean up assets, you can use capistrano-rails. Just require 'capistrano/rails' in Capfile and...

Let's say you have two XML strings that are ordered differently but you don't care about the order of attributes inside containers: a = ' batman secret ' b = ' secret batman...

xml_parser.parse(a) => {:authenticate=>{:user=>"batman", :password=>"secret"}} xml_parser.parse(a) == xml_parser.parse(b) => true Note: order in XML can be important (e.g. XHTML). For cases where it's not, you can...

...the necessary parameters instead. that is for example caused by url_for( :overwrite_params => { :order => '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', :dir => 'asc' } ) Note: link_to uses url_for internally, so you can can use params.merge...

Stick.shuffled.first Or, if you prefer something smaller: class Stick named_scope :shuffled, :order => 'RAND()' end Note however that you should never order by RAND() on tables that may...

...In most cases it is sufficient to delete and recreate the local database in order to import the dump. If any problems occur, proceed as follows: 1. Figure out the...

postgresql.org

...If you use the ARRAY[] syntax, you'll need to add a type in order to perform operations with e.g. a string array column: ARRAY['one', 'two']::varchar[].

...configuration) at some point Capistrano tries to check out code from your repository. In order to do so, Capistrano connects to your repository server from the application server you're...