...at its maximum width without any indentation. This will make code blocks difficult to read. See also: CSS: Flex and "min-width...
...up as unresponsive, with a ping timeout after 10 seconds. The logfile will generally read like this: operation queue.delete caused a channel exception not_found: failed to perform operation on...
...a TimeWithZone). You need to use Time.current, Date.current, DateTime.current, Time.zone.parse, etc. everywhere. You should read this guide for a pretty exhaustive list of all the things you need to pay...
...Rails 3, open config/environment.rb and define your time zone: config.time_zone = 'Berlin' Again, please read the working with time zones in Ruby on Rails from Elabs before you do anything...
...place where the application usually gets its keys from. The keytool is able to read certificate files but does not understand private key files which you need to use your...
...application created by AgentBob and also attached to this note. You do want to read through such code first and not mindlessly use it on your private keys.
...using this regularly, as it has high potential to make your tests hard to read and understand. You're often better of by using factories, generally different implementation patterns, or...
...the article using a different formatting style so that it jumps out at the reader. Blatantly copying the excerpt of the pull quote into it’s own element is not...
...a structural representation of the excerpt would be seen twice by people using feed readers or services like Instapaper, as well as be re-read for people who use screen...
To read the Rails session from a Rack middleware, use env['rack.session']. It's an ActionDispatch::Request::Session object. class MyMiddlware def initialize(app) @app = app end def call(env...
If you need to capture signatures on an IPad or similar device, you can use Thomas J Bradley's excellent...
...seems not as obvious as if you are using JSON. To safely write and read YAML files you should use Psych#dump (String#to_yaml) and Psych.safe_load (YAML.safe_load...
You can use heredoc to avoid endlessly long lines of code that nobody can read. Heredoc strings preserve linebreaks and can be used like this: def long_message
...cap production app:logs 00:00 app:logs 01 tail -n0 -F /var/www/your-application/shared/log/production.log | while read line; do echo "$(hostname): $line"; done 01 app01-prod: Started GET "/sign_in" for 1.2.3.4 at...
...LOG'] || fetch(:rails_env) execute %(tail -n0 -F #{shared_path}/log/#{logfile}.log | while read line; do echo "$(hostname): $line"; done) end end end If you have some other log...
MuPDF is a PDF reader that renders very quickly, yet still correctly. It supports PDF 1.7 and all the fancy shenanigans that evince (Ubuntu's default PDF reader) fails to...
...your latest-version PDF documents properly, you probably still have to resort to Adobe Reader or the lp command...
...use a form object here" You can learn about new code patterns You should read the sections "Advantages of using design patterns" and "Disadvantages of using design patterns in a...
Call and Debug a Function Pause Execution on URL Change Debugging Property Reads Use copy() Debugging HTML/CSS
Learn to read and write Haml. Understand the different attributes syntaxes (curly braces vs. round parentheses) Exercises Convert MovieDB from ERB to Haml Hint The Haml-tutorial doesn't...
"rock it Español style".to_url => "rock-it-espanol-style" "tell your readers 你好".to_url => "tell-your-readers-ni-hao" The above conversions of special chars, like...
...conditions => ['state = ?', 'draft']) or a hash (:conditions => { 'state' => 'draft' }). The later is nicer to read, but has horrible security implications in some versions of Ruby on Rails. Affected versions
...Encoding.default_external, notably the string inside a StringIO.new some strings created via CSV files read from disk strings read from an IRB Encoding.default_external defaults to whatever locale charmap says...
...Applied to files > creates or overwrites a file >> creates or appends to a file < reads from a file, where < is taken as 0< Note: You should be pretty sure of...
...grep da * 1>&2 everything: do_stuff &> /dev/null combined: command < input-file > output-file, reads from input-file and writes stdout to output-file
...it with two niceties: support for passing a block (which could e.g. render a "read on" link), and html_safe knowledge. Prefer the truncate() helper Warning: truncate() calls html_safe...
...browser. Rails has a second pipeline called webpacker, which we will cover later. Learn Read Everything You Should Know About the Rails Asset Pipeline Read How to make your application...
...assets cachable in Rails Read Managing vendor libraries with the Rails asset pipeline Understand What is "sprockets" and how does it relate to the asset pipeline? What is a "manifest...
The code below shows a method #validate which uses Nokogiri to validate an XML document against an XSD schema. It...
file.write open('http://example.com/your.file', :http_basic_authentication => [your_username, your_password]).read
...line tool and client for uploading, retrieving and managing data in Amazon S3. S3cmd reads its configuration by default from ~/.s3cfg, which is created once you run s3cmd --configure.