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
# got this from http://stackoverflow.com/questions/8672809/use-ffmpeg-to-add-text-subtitles | |
ffmpeg -i infile.mp4 -f srt -i infile.srt -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=chi outfile.mp4 | |
# confirmed working with the following ffmpeg | |
# (installed using `brew 'ffmpeg', args: ['with-libvorbis', 'with-libvpx']` ) | |
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers | |
built with Apple clang version 12.0.0 (clang-1200.0.32.2) | |
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libx |
// Usage: phantomjs openload.js <video_url> | |
// if that doesn't work try: phantomjs --ssl-protocol=any openload.js <video_url> | |
var separator = ' | '; | |
var page = require('webpage').create(), | |
system = require('system'), | |
id, match; | |
if(system.args.length < 2) { | |
console.error('No URL provided'); |
import React from 'react'; | |
import { renderToStaticMarkup } from 'react-dom/server'; | |
class SvgBackground extends React.Component { | |
render() { | |
return ( | |
<svg xmlns='http://www.w3.org/2000/svg' width={100} height={100}> | |
<rect width={100} height={100} fill='#269' /> | |
<g fill='#6494b7'> | |
<rect width={100} height={1} y={20} /> |
/* | |
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
It will generate several classes such as: | |
.m-r-10 which gives margin-right 10 pixels. | |
.m-r-15 gives MARGIN to the RIGHT 15 pixels. | |
.m-t-15 gives MARGIN to the TOP 15 pixels and so on. | |
.p-b-5 gives PADDING to the BOTTOM of 5 pixels | |
.p-l-40 gives PADDING to the LEFT of 40 pixels |
#!/bin/bash | |
aria2c -j5 -i list.txt -c --save-session out.txt | |
has_error=`wc -l < out.txt` | |
while [ $has_error -gt 0 ] | |
do | |
echo "still has $has_error errors, rerun aria2 to download ..." | |
aria2c -j5 -i list.txt -c --save-session out.txt | |
has_error=`wc -l < out.txt` | |
sleep 10 |
## Global install of the app generator | |
npm install -g create-react-app | |
## Setup the app (first-time only) | |
create-react-app my-app | |
cd my-app | |
git init | |
# Create the Heroku app; requires free account at https://www.heroku.com/ | |
heroku create -b https://github.com/heroku/heroku-buildpack-static.git |
#!/bin/bash | |
sudo add-apt-repository -y ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git -y |
server { | |
listen 80; | |
server_name localhost; | |
root /Users/YOUR_USERNAME/Sites; | |
access_log /Library/Logs/default.access.log main; | |
location / { | |
include /usr/local/etc/nginx/conf.d/php-fpm; | |
} |
/** | |
* How to: | |
* $('div.container').imagesLoaded(function(){console.log('all images loaded in .container');}); | |
* In case you need to support IE8, you need to use HTML5shiv **and** need to modify jQuery the following way: | |
* https://github.com/jquery/jquery/commit/a9533893b9e5e9a248139f5794c5d6099382cf14 | |
*/ | |
(function($){ | |
'use strict'; | |
$.fn.imagesLoaded = (function(){ | |
var imageLoaded = function (img, cb, delay){ |