ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 filename-here.mp4
you will see file resolution like 1280x720
then resize to expected resolution:
Validator::extend('slug', function($attribute, $value, $parameters, $validator) { | |
return preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/', $value); | |
}); |
$client = new Client(); | |
$array = []; | |
$res = $client->request('POST', $url, [ | |
'body' => json_encode($array), | |
'headers' => [ | |
'Content-Type' => 'application/json', | |
] | |
]); |
@startuml | |
' uncomment the line below if you're using computer with a retina display | |
' skinparam dpi 300 | |
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >> | |
' we use bold for primary key | |
' green color for unique | |
' and underscore for not_null | |
!define primary_key(x) <b>x</b> | |
!define unique(x) <color:green>x</color> | |
!define not_null(x) <u>x</u> |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
ssh-keygen -t rsa -b 4096 -C "achmadfatoni(replace with name)" |
<?php | |
namespace App\Http\Controllers; | |
use App\Models\Post; | |
use Illuminate\Http\Request; | |
class PostController extends Controller | |
{ | |
public function store(Request $request) |
#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version. | |
This tutorial is the improvised verision of this [tutorial on Digitalocean](https://www.digitalocean.com/community/tutorials/how-to-install-laravel-with-an-nginx-web-server-on-ubuntu-14-04) based on my experience. | |
## Install PHP 7 on Ubuntu | |
Run the following commands in sequence. | |
``` | |
sudo apt-get install -y language-pack-en-base | |
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
sudo apt-get install zip unzip |
<?php | |
/** | |
* It's an algorithm for generating a random permutation of a finit sequence - in plain terms, the algorithm shuffles the sequence. | |
* | |
* Reference: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle | |
*/ | |
function MyShuffle(&$arr) { |
## http://domain.com and http://www.domain.com redirect to https://www.domain.com | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
server_name domain.com www.domain.com; | |
include /etc/nginx/snippets/letsencrypt.conf; | |
location / { | |
return 301 https://www.domain.com$request_uri; |