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:
| #!/bin/bash | |
| # | |
| # @file normalize.sh | |
| # | |
| # @requires the perl 'rename' utility | |
| # | |
| ################################################################################ | |
| # force to lowercase | |
| find . -iregex ".+\.\(jpe?g\|png\)" | rename 'y/A-Z/a-z/' |
| // https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Protocols.html | |
| print("Brick maker!") | |
| // for testing on http://swiftlang.ng.bluemix.net/ | |
| typealias CGFloat = Float | |
| struct CGPoint { | |
| var x: CGFloat | |
| var y: CGFloat |
| # Next Youtube Video in Playlist | |
| tell application "Google Chrome" | |
| repeat with t in tabs of windows | |
| tell t | |
| if URL starts with "http://www.youtube.com/watch" or URL starts with "https://www.youtube.com/watch" then | |
| execute javascript " | |
| var player = document.getElementById('movie_player') || document.getElementsByTagName('embed')[0]; | |
| if (player) { | |
| document.getElementsByClassName('ytp-next-button')[0].click() |
| // port of http://stackoverflow.com/a/17948778/3071224 | |
| import UIKit | |
| import Foundation | |
| extension CGSize { | |
| static func aspectFit(aspectRatio : CGSize, var boundingSize: CGSize) -> CGSize { | |
| let mW = boundingSize.width / aspectRatio.width; | |
| let mH = boundingSize.height / aspectRatio.height; |
| <?php | |
| // Converts a number into a short version, eg: 1000 -> 1k | |
| // Based on: http://stackoverflow.com/a/4371114 | |
| function number_format_short( $n, $precision = 1 ) { | |
| if ($n < 900) { | |
| // 0 - 900 | |
| $n_format = number_format($n, $precision); | |
| $suffix = ''; | |
| } else if ($n < 900000) { |
| <?php | |
| /** | |
| * Dirty, dirty Reddit bot: Decronym | |
| */ | |
| class Reddit { | |
| const USERNAME = 'Decronym'; | |
| const PASSWORD = '***'; | |
| const CLIENTID = '***'; | |
| const SECRET = '***'; |
| // reference: https://github.com/pepelkod/iOS-Examples/blob/master/PlaySoundWithVolume/PlaySoundWithVolumeAction.m | |
| import SpriteKit | |
| public extension SKAction { | |
| public class func playSoundFileNamed(fileName: String, atVolume: Float, waitForCompletion: Bool) -> SKAction { | |
| let nameOnly = fileName.stringByDeletingPathExtension | |
| let fileExt = fileName.pathExtension | |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't