I use Valet as my local web development environment (PHP, Laravel, Wordpress, ...)
This gist is my own recipe to install Wordpress from the command line to use it with Valet. Maybe this is useful for you too.
import React from 'react'; | |
import { Meteor } from 'meteor/meteor'; | |
import { render } from 'react-dom'; | |
class Counter extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = {count: props.initialCount}; | |
this.tick = this.tick.bind(this); | |
} |
import { Template } from 'meteor/templating'; | |
import { ReactiveVar } from 'meteor/reactive-var'; | |
import './main.html'; | |
Template.hello.onCreated(function helloOnCreated() { | |
// counter starts at 0 | |
this.counter = new ReactiveVar(0); | |
}); |
// Slugify a string | |
// taken from https://www.lucidar.me/en/web-dev/how-to-slugify-a-string-in-php/ | |
function slugify($text) | |
{ | |
// Strip html tags | |
$text=strip_tags($text); | |
// Replace non letter or digits by - | |
$text = preg_replace('~[^\pL\d]+~u', '-', $text); | |
// Transliterate | |
setlocale(LC_ALL, 'en_US.utf8'); |
// Slugify a string | |
// taken from https://www.lucidar.me/en/web-dev/how-to-slugify-a-string-in-javascript/ | |
function slugify(str) | |
{ | |
str = str.replace(/^\s+|\s+$/g, ''); | |
// Make the string lowercase | |
str = str.toLowerCase(); |
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |
// require moment and lodash | |
import moment from 'moment'; | |
import _ from 'lodash'; | |
// Option 1 | |
function sortByDate(array, element) { | |
const sortedArray = array.sort((a, b) => moment(a[element]).diff(moment(b[element]))); | |
return sortedArray; | |
} |
# Installation | |
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
# Easy Peasy | |
ffmpeg -i video.mp4 video.webm |
brew options ffmpeg | |
brew install ffmpeg \ | |
--with-chromaprint \ | |
--with-fdk-aac \ | |
--with-fontconfig \ | |
--with-freetype \ | |
--with-frei0r \ | |
--with-game-music-emu \ | |
--with-libass \ |
FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.
Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:
ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4
Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.