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:
docker_compose_exec() { | |
docker exec -it $(docker-compose ps | grep $1 | awk '{print $1}') ${@:2} | |
} | |
alias dcrun='docker_compose_exec web' | |
alias dcenter='docker_compose_exec web bash' | |
alias dcenter_new='docker-compose run web bash' # if container is not up |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Leaflet Image</title> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css' rel='stylesheet' /> |
ActiveSupport.on_load(:active_record) do | |
module Arel::NullsLastPredications | |
def nulls_last | |
Arel::Nodes::NullsLast.new self | |
end | |
end | |
module Arel::Nodes | |
class NullsLast < Unary | |
def gsub *args |
$('form').on('change', '.image_preview input[type="file"]', function(e) { | |
var files = e.target.files, | |
f = files[0], | |
reader = new FileReader(), | |
t = this | |
; | |
reader.onload = (function(file) { |
#!/usr/bin/env ruby | |
# A script that will pretend to resize a number of images | |
require 'optparse' | |
# This hash will hold all of the options | |
# parsed from the command-line by | |
# OptionParser. | |
options = {} | |
optparse = OptionParser.new do|opts| |