States (buttons, form elements) Interpretation of content is simplified for parsers (screen readers, search engine spiders) Sectioning HTML documents HTML5 brought a batch of new section elements, the...
...may be used to provide the expanded version. data: some data, where the machine-readable form is given in the value attribute. E.g. for dates time: some datetime expression (see...
...users not only to access those files but also any files your application can read, like this: invoices/generated?number=../../../../../etc/passwd # => send_file '/etc/passwd' You do not want this. In most...
...at its maximum width without any indentation. This will make code blocks difficult to read. See also: CSS: Flex and "min-width...
...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.
...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...
If you need to capture signatures on an IPad or similar device, you can use Thomas J Bradley's excellent...
...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...
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...
...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...
...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...
...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...
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
Call and Debug a Function Pause Execution on URL Change Debugging Property Reads Use copy() Debugging HTML/CSS
"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...
...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
...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
The code below shows a method #validate which uses Nokogiri to validate an XML document against an XSD schema. It...
...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...
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.
...htpasswd -v htpass_test firstname.lastname You probably should not use the -b switch to read the password from the command line as the password will then be visible in your...