Skip to content

Instantly share code, notes, and snippets.

View NazmusShakib's full-sized avatar
:octocat:
Working from home

Nazmus Shakib NazmusShakib

:octocat:
Working from home
View GitHub Profile
<?php
///////////////////////////////////////////////////
// STEP 1 - CREATE CLASS THAT WILL BE USED GLOBALY
///////////////////////////////////////////////////
namespace App\MyApp;
class MyApp {
public function sayHello($data = [])
{
echo "Hello World from Facade!";
}
@NazmusShakib
NazmusShakib / woo-paypal.php
Created February 8, 2018 06:02
Custom WooCommerce PayPal Gateway
<?php
/**
* Plugin Name: Custom WooCommerce PayPal Gateway
*/
/** NOTES
* Downlaod Paypal SDK: https://github.com/paypal/PayPal-PHP-SDK/releases
* I have download it from https://github.com/paypal/PayPal-PHP-SDK/releases/download/1.7.4/PayPal-PHP-SDK-1.7.4.zip here
* Extract this in your plugin directory > includes > paypal-sdk
@NazmusShakib
NazmusShakib / AuthController.php
Last active April 1, 2018 10:49
Register user and generate JWTAuth token for users
<?php
namespace App\Http\Controllers;
use App\Http\Requests\RegisterFormRequest;
use Illuminate\Support\Facades\Auth;
use Tymon\JWTAuth\Facades\JWTAuth;
use Illuminate\Http\Request;
use App\User;
@NazmusShakib
NazmusShakib / RegisterFormRequest.php
Created February 19, 2018 11:03
Register form request validation
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class RegisterFormRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
@NazmusShakib
NazmusShakib / User.php
Last active April 17, 2018 04:27
Most of all the same only sum up getJWTIdentifier getJWTCustomClaims method with there entrust dependency.
<?php
namespace App;
use Tymon\JWTAuth\Contracts\JWTSubject;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable implements JWTSubject
{
@NazmusShakib
NazmusShakib / api.php
Last active March 21, 2018 07:31
Laravel 5.6 jwt routing.
<?php
Route::post('signup', 'AuthController@register');
Route::post('login', 'AuthController@login');
Route::group(['prefix' => 'auth', 'middleware' => 'jwt.auth'], function () {
Route::get('user', 'AuthController@user');
Route::post('logout', 'AuthController@logout');
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
import datetime
import boto3
client = boto3.client(
'ses',
region_name = 'us-east-1',
aws_access_key_id = 'IUITRERTTUUOI',
sudo apt install libapache2-mod-php7.0 php7.0-xml php7.0-gd php7.0-opcache php7.0-mbstring php7.0-fpm php7.0-intl php7.0-imap php7.0-pgsql php7.0-soap php7.0-zip php7.0-bcmath php-pear php7.0-zip php7.0-curl php7.0-mysql php7.0-mcrypt
# Need to modify and run::
$ vim /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All # None to All
-- Download the Postman from: https://www.getpostman.com/downloads
-- Extract and move it to: /opt/
-- Then open terminal and execute below code:
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Version=1.0
@NazmusShakib
NazmusShakib / concatenate-media-files.py
Created June 12, 2019 18:55
ffmpeg: merge multiple MP4 files, it's necessary to pass by .ts files
import os
import subprocess
import glob
def main():
tsFileList = []
# consider only .mp4 files
files = glob.glob('*.mp4')
for file in files: