A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
| <?php | |
| declare(strict_types=1); | |
| namespace App\Lib\Helpers; | |
| use Illuminate\Support\Facades\DB; | |
| class PostgreEnum { |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
| #!/bin/bash | |
| # This script will extract the certificate and key from an .ovpn file | |
| # into their own files, which makes it possible to use them to configure | |
| # the VPN using Ubuntu's network manager | |
| # Usage example: | |
| # >> ovpnconvert username.dev.ovpn | |
| # You can keep following these instructions here: |
| let orderbyDimensions = images => { | |
| let promises = []; | |
| // console.log('to order by dimensions', images); | |
| images.forEach(imgUrl => { | |
| let img= new Image; | |
| img.src = imgUrl; | |
| let promise = new Promise( (resolve, reject) => { | |
| img.onload=function(){ | |
| resolve({with: this.width, h:this.height, max: this.width*this.height, url: imgUrl}); |
| <?php | |
| namespace App\Library\IbmApi; | |
| use App\Library\IbmApi\Exceptions\IbmException; | |
| use Log; | |
| /** | |
| * Natural language processing for advanced text analysis | |
| */ | |
| class NaturalLanguageProcessingApi { |
| <?php | |
| # Folder in which current tiles reside | |
| $currentTilesFolder = 'tiles'; | |
| # Timeout between requests so script doesnt get blocked | |
| $timeout = 1; | |
| # Init recusrive iterator | |
| $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($currentTilesFolder)); |
| fetch('http://mydomain.local/api/photo', { | |
| method: 'POST', | |
| mode: 'cors', | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| }, | |
| body: JSON.stringify({'lat': 12121, lng: 1212121, title: 'dasdasdsa', 'image': 'data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg=='}) | |
| }).then(res => { | |
| console.log('res', res); | |
| }).catch(err => { |
| .select2-selection__rendered { | |
| line-height: 31px !important; | |
| } | |
| .select2-container .select2-selection--single { | |
| height: 35px !important; | |
| } | |
| .select2-selection__arrow { | |
| height: 34px !important; |
| <?php | |
| # Note that 8080 is the port to my Node.js server - you may want to change. | |
| function sio_message($message, $data) { | |
| $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
| $result = socket_connect($socket, '127.0.0.1', 8080); | |
| if(!$result) { | |
| die('cannot connect '.socket_strerror(socket_last_error()).PHP_EOL); | |
| } | |
| $bytes = socket_write($socket, json_encode(Array("msg" => $message, "data" => $data))); |
| server { | |
| listen 80; | |
| server_name laravel-project.local; | |
| root /vagrant/code/laravel-project/public; | |
| index index.php index.html; |