Skip to content

Instantly share code, notes, and snippets.

View m074554n's full-sized avatar
🏠
Keep Learning By Doing

Mohamed Hassan m074554n

🏠
Keep Learning By Doing
  • Laravel
  • Global Citizen
View GitHub Profile
@m074554n
m074554n / MediaVideoConverterListener.php
Created January 3, 2023 13:17 — forked from Nks/MediaVideoConverterListener.php
Laravel Media Library converting video to .mp4 after saving
<?php
namespace App\Listeners;
use App\Media;
use FFMpeg\FFMpeg;
use FFMpeg\Format\Video\X264;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\SerializesModels;
@m074554n
m074554n / ffmpeg-watermark.md
Created November 9, 2022 22:00 — forked from bennylope/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

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.

@m074554n
m074554n / submit.md
Created September 10, 2022 20:45 — forked from tanaikech/submit.md
Sample Scripts for Creating New Event with Google Meet Link to Google Calendar using Various Languages

Sample Scripts for Creating New Event with Google Meet Link to Google Calendar using Various Languages

This is the sample scripts for creating new event with Google Meet link to Google Calendar using various languages. When I saw the official document of "Add video and phone conferences to events", in the current stage, I can see only the sample script for Javascript. But I saw the several questions related to this for various languages. So I published the sample scripts for creating new event with Google Meet link to Google Calendar using various languages.

In order to create new event with Google Meet link to Google Calendar, it is required to set the request body and query parameter as follows.

Please add the following object to the request body.

conferenceData: {
<?php
declare(strict_types=1);
namespace App\Http\Controllers;
use App\Models\User;
use App\Models\UserEmailAddress;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
<?php
declare(strict_types=1);
namespace App\Http\Controllers;
use App\Models\UserEmailAddress;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Symfony\Component\HttpFoundation\Response;
<?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class UserEmailAddress extends Model implements MustVerifyEmail
{
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
@m074554n
m074554n / aws-sdk-invoke-lambda-function.php
Last active February 16, 2022 20:08
Invoking Lambda function through AWS PHP SDK
<?php
declare(strict_types=1);
$lambdaClient = new \Aws\Lambda\LambdaClient([
'version' => 'latest',
'region' => 'eu-west-1',
'credentials' => [
'key' => 'AWS_ACCESS_KEY_ID',
'secret' => 'AWS_SECRET_ACCESS_KEY',
],
[
{
"code": "AF",
"name": "Afghanistan"
},
{
"code": "AL",
"name": "Albania"
},
{