Let's have a look at the internal transformation process of ffmpeg. It includes (de)muxing packets and de/encoding frames to keep everything in sync. The ASCII illustration is...
...Video Playback" section). The result can be verified with ffmpeg -i output.mp4 and should include lines similar to these: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
...Usage in RSpec feature specs Copy the DownloadHelpers module to spec/support. You can now include the helper in all your feature specs: RSpec.configure do |config| config.include(DownloadHelpers, type: :feature)
...Usage in Cucumber scenarios Copy the DownloadHelpers module to features/support. Then include the helper in your scenarios and define some step definitions: World(DownloadHelpers) When('I download {string}') do |locator...
Expected [...] to contain exactly "XXX" ActiveRecord::Base is monkey patched by super_diff/rspec-rails (includes rspec and rails) super_diff/rails (includes active_record and active_support) super_diff/active_record
...single child element: hello When we query that element for its children, some properties include text nodes: container.children // => [span] container.childNodes // => [text, span, text] In this example, the text nodes are...
...some benefits over placing fonts into your repo: All font weights and glyphs are included. You don't need to download and add files for latin, greek, cyrillic, or other...
...contain different unicode-range values which map different font files to the glyphs they include. This means that e.g. the file for cyrillic glyphs is only loaded when any text...
...Lockstep.synchronize end end Note that this method uses capybara-lockstep in the last line. Include this module in your test suite and call conclude_browser_requests at the end of...
...HTML. Be it some localized link, or some tags for formatting that you wantto include in your translated text. Example: # e.g. config/locales/en.yml en: page: text: 'Please visit our corporate website...
Our applications not only need to be functional, they need to be fast. But, to quote Donald Knuth, premature optimization...
...your particular development server shows an error. Warning Unpoly cannot repeat form submissions that include file inputs. If it tries, the file data will be replaced with the string [object...
...To avoid confusion, this code will instead redirect to /__better_errors when a file is included in the submission. // Only do this in development. This requires a `[data-environment="development"]` attribute...
4 0 - 5 Dev machines are not blocked on test runs; Code Reviews include test badge; Automatically merge a PR on green tests Upgrade Rails 5 0 - 5
...client: Make a POST request with method override The default configuration Rails and Sinatra includes a Rack middleware that lets you control the HTTP method used for routing by POSTing...
...mail (or even password reset e-mail), or something similar. The e-mail also includes some reflected text. For example, a user may be able to give their name, and...
...is used within the e-mail. The spammer will then abuse that text to include his advertisment. Potential counter measures are: Add a captcha. Rate limit the sign-up or...
...and we need to prepend the class to define class methods. Test class Test; include SuperClient; end Test.foo => 'New foo' Test.new.bar => 'New bar' Good practice If you do monkey patches...
...e.g. all attributes need to be present when initializing an object. Example: class User include ActiveModel::Attributes attribute :salutation attribute :first_name attribute :last_name attribute :street_and_number
...a webkitRelativePath property which lists the relative file path, starting from the selected directory (including it). Example: http://jsfiddle.net/xozvprdj/ Note that Chrome will show a confirmation prompt to make...
...HTML. As a fallback for older browsers you can use name (which won't include any path). See also File System Access API: Recursive Directory Traversal
Add zip_tricks to your Gemfile and bundle install. In your controller, include ZipTricks::RailsStreaming. You can then use the zip_tricks_stream method in controller actions to...
...own Last-Modified or ETag header to achieve that. Example controller: class DocumentsController < ApplicationController include ZipTricks::RailsStreaming def download documents = Document.all fresh_when Time.current # Sets `Last-Modified` header (see above...
...used (in development and tests)' do get 'http://www.example.com/test/set_cookie' response.headers['Set-Cookie'].should include('test=') # Cookie is still set response.headers['Set-Cookie'].should_not include('; Secure') end end
SimpleForm comes with an option browser_validations which could be used to give fields that have a presence validation the...
...also need to override some methods, you can do this: class HelperProxy < ActionView::Base include ApplicationController.master_helper_module def current_user #let helpers act like we're a guest
Bare metal If you have strong nerves, you can also try to include the ApplicationController.master_helper_module directly into your model...
Consider the following example from the Modularity README: # app/models/article.rb class Article < ActiveRecord::Base include DoesStripFields[:name, :brand] end # app/models/shared/does_strip_fields.rb module DoesStripFields as_trait do |*fields| fields.each do |field|
...Modularity source code and understand how the implementation works. In particular, understand this syntax: include DoesStripFields[:name, :brand] What exactly is included here? How does Modularity enable parameterized modules? How...
...excludes spaces, control characters, and similar) /[[:lower:]]/ Lowercase alphabetical character /[[:print:]]/ Like [[:graph:]], but includes the space character /[[:punct:]]/ Punctuation character /[[:space:]]/ Whitespace character ([[:blank:]], newline, carriage return, etc.)
...you need to skip those items that are #marked_for_destruction?. Otherwise you will include items that have been ticked for deletion in a nested form. See ActiveRecord: When aggregating...
...pick up and notify you so you can fix it. Note StandardError does not include all error classes. So, while it might seem that rescue without specifying exception classes might...
...you have the following code: module Mod def foo @@foo end end class Klass include Mod end @@foo does not mean Klass::@@foo (qualifier added to make my point; it...
...Ruby expression). It actually means Mod::@@foo and is shared between Mod, all classes including Mod as well as all their subclasses. Also note that only the class and module...