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:
| @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 | |
| /** | |
| * 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; |
| $client = new Client(); | |
| $array = []; | |
| $res = $client->request('POST', $url, [ | |
| 'body' => json_encode($array), | |
| 'headers' => [ | |
| 'Content-Type' => 'application/json', | |
| ] | |
| ]); |
| public function delete($id) | |
| { | |
| $post = Post::find($id); | |
| if ($post) { | |
| $post->delete(); | |
| return response()->json([ | |
| 'message' => 'Post has been deleted' | |
| ]); |
| <?php | |
| namespace App\Models; | |
| use Illuminate\Database\Eloquent\Model; | |
| class Post extends Model | |
| { | |
| protected $table = 'posts'; |
| public function update(Request $request, $id) | |
| { | |
| $post = Post::find($id); | |
| if ($post) { | |
| $post->update($request->all()); | |
| return response()->json([ | |
| 'message' => 'Post has been updated' | |
| ]); |