Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus| # webm | |
| ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm | |
| # mp4 | |
| ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4 | |
| # ogg (if you want to support older Firefox) | |
| ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend |
| /* | |
| convertVideo_config: { | |
| ffmpeg: 'bin/ffmpeg/./ffmpeg', | |
| mp4: '-vcodec libx264', | |
| m4v: '-vcodec libx264', | |
| '3gp': '-acodec libvo_aacenc -vcodec libx264', | |
| webm: '-acodec libvorbis -vcodec libvpx', | |
| ogv: '-acodec libvorbis' | |
| }, |
| -- Decoding | |
| SELECT CONVERT_FROM(DECODE(field, 'BASE64'), 'UTF-8') FROM table; | |
| -- Encoding | |
| SELECT ENCODE(CONVERT_TO(field, 'UTF-8'), 'base64') FROM table; |
| [ { "gentilico" : "afegãne", | |
| "nome_pais" : "Afeganistão", | |
| "nome_pais_int" : "Afghanistan", | |
| "sigla" : "AF" | |
| }, | |
| { "gentilico" : "sul-africana", | |
| "nome_pais" : "África do Sul", | |
| "nome_pais_int" : "South Africa", | |
| "sigla" : "ZA" | |
| }, |
lanetix=# \d foo
Table "scripting.foo"
Column | Type | Modifiers
--------+-----------------------+-----------
id | integer | not null
a | character varying(40) | not null
b | character varying(40) | not null
c | character varying(40) | not null| /* | |
| https://www.smashingmagazine.com/2016/07/improving-user-flow-through-page-transitions/ | |
| You can copy paste this code in your console on smashingmagazine.com | |
| in order to have cross-fade transition when change page. | |
| */ | |
| var cache = {}; | |
| function loadPage(url) { | |
| if (cache[url]) { |
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'lanetix=# \d foo
Table "scripting.foo"
Column | Type | Modifiers
--------+-----------------------+-----------
id | integer | not null
a | character varying(40) | not null
b | character varying(40) | not null
c | character varying(40) | not null