Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
You can get the list of installed codecs with:
| import Cocoa | |
| import Foundation | |
| class Block { | |
| var index: Int = 0 | |
| var dateCreated: String | |
| var previousHash: String! | |
| var hash: String! | |
| var nonce: Int | |
| #!/usr/bin/ruby | |
| require 'xcodeproj' | |
| # ============================================ | |
| # !!! I've released a ruby gem that does the same thing, but better. | |
| # You can install it by running `gem install xcprovisioner` or | |
| # `sudo gem install xcprovisioner` if it asks for sudo rights. | |
| # | |
| # For more info: https://github.com/thelvis4/XCProvisioner |
| extension CMDeviceMotion { | |
| func gaze(atOrientation orientation: UIInterfaceOrientation) -> SCNVector4 { | |
| let attitude = self.attitude.quaternion | |
| let aq = GLKQuaternionMake(Float(attitude.x), Float(attitude.y), Float(attitude.z), Float(attitude.w)) | |
| let final: SCNVector4 | |
| switch orientation { |
| require "active_record" | |
| namespace :db do | |
| db_config = YAML::load(File.open('config/database.yml')) | |
| db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
| desc "Create the database" | |
| task :create do | |
| ActiveRecord::Base.establish_connection(db_config_admin) |
| ACTION | |
| AD_HOC_CODE_SIGNING_ALLOWED | |
| ALTERNATE_GROUP | |
| ALTERNATE_MODE | |
| ALTERNATE_OWNER | |
| ALWAYS_SEARCH_USER_PATHS | |
| ALWAYS_USE_SEPARATE_HEADERMAPS | |
| APPLE_INTERNAL_DEVELOPER_DIR | |
| APPLE_INTERNAL_DIR | |
| APPLE_INTERNAL_DOCUMENTATION_DIR |
The normal controller/view flow is to display a view template corresponding to the current controller action, but sometimes we want to change that. We use render in a controller when we want to respond within the current request, and redirect_to when we want to spawn a new request.
The render method is very overloaded in Rails. Most developers encounter it within the view template, using render :partial => 'form' or render @post.comments, but here we'll focus on usage within the controller.
| # A small DSL for helping parsing documents using Nokogiri::XML::Reader. The | |
| # XML Reader is a good way to move a cursor through a (large) XML document fast, | |
| # but is not as cumbersome as writing a full SAX document handler. Read about | |
| # it here: http://nokogiri.org/Nokogiri/XML/Reader.html | |
| # | |
| # Just pass the reader in this parser and specificy the nodes that you are interested | |
| # in in a block. You can just parse every node or only look inside certain nodes. | |
| # | |
| # A small example: | |
| # |