Skip to content

Instantly share code, notes, and snippets.

View ManiruzzamanAkash's full-sized avatar
👨‍💻
Building the Better World By Writing Stuffs...

Maniruzzaman Akash ManiruzzamanAkash

👨‍💻
Building the Better World By Writing Stuffs...
View GitHub Profile
<?php
namespace SureCart\Integrations\Elementor\Widgets\Nested;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Product widget.
@ManiruzzamanAkash
ManiruzzamanAkash / ImageUploadTrait.php
Created January 14, 2024 20:28
Image Upoader Trait for Learning
<?php
declare(strict_types=1);
namespace App\Traits;
use Exception;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
@ManiruzzamanAkash
ManiruzzamanAkash / SitemapController.php
Created January 9, 2024 17:16
SiteMap Generator PHP - Laravel
<?php
namespace App\Http\Controllers;
use App\Models\Category;
use App\Models\CodeExample;
use App\Models\Course;
use App\Models\CssCode;
use App\Models\Developer;
use App\Models\Page;
use App\Models\Post;
@ManiruzzamanAkash
ManiruzzamanAkash / wp-sitemap-generator-example.php
Created August 15, 2023 04:36
WordPress sample test Sitemap generator example
<?php
wp_register_sitemap_provider( 'test', new TestSiteMap() );
/**
* XML sitemap provider.
*/
class TestSiteMap extends \WP_Sitemaps_Provider {
public function __construct() {
@ManiruzzamanAkash
ManiruzzamanAkash / movies.json
Created August 12, 2023 17:00
Movies List API
[
{
"title": "Avatar: The Way of Water",
"slug": "avatar-the-way-of-water",
"coming_soon": false,
"year": "2022",
"rated": "PG-13",
"released": "16 Dec 2022",
"runtime": "192 min",
"genre": "Action, Adventure, Fantasy",
@ManiruzzamanAkash
ManiruzzamanAkash / github-workflow-laravel-pest-pint.yml
Last active May 13, 2023 18:04
Github Workflow for Laravel Pest and with Pint Complete Example
# Doc Link - https://devsenv.com/tutorials/how-to-setup-github-workflow-for-laravel-pint-and-php-pest-testing
name: Laravel Tests
on:
pull_request:
branches:
- main
push:
branches:
- main
@ManiruzzamanAkash
ManiruzzamanAkash / next-js-static-props-static-paths-json-placeholder.jsx
Created April 28, 2023 03:59
Post list and detail page with Next JS static site props and staticpaths
// pages/posts/index.jsx
import Head from "next/head";
import Link from "next/link";
export default function PostsPage({ posts }) {
return (
<>
<Head>
<title>DevsEnv | Posts</title>
@ManiruzzamanAkash
ManiruzzamanAkash / Delete all tables from a database MySQL.sql
Last active April 17, 2023 07:11
Delete all tables from a database MySQL
USE [database_name];
SET FOREIGN_KEY_CHECKS = 0;
SET GROUP_CONCAT_MAX_LEN=32768;
SELECT GROUP_CONCAT(CONCAT('`', table_name, '`') SEPARATOR ',') INTO @tables
FROM information_schema.tables
WHERE table_schema = '[database_name]';
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
SET FOREIGN_KEY_CHECKS = 1;
@ManiruzzamanAkash
ManiruzzamanAkash / How to upload the plugin changes to the WordPress marketplace.MD
Created April 4, 2023 10:00
How to upload the plugin changes to the WordPress marketplace

How to upload the plugin changes to the WordPress marketplace.

  1. Download the plugin repository Create a directory in Projects called woomarket/, and go to it. Use this command to download the plugin.
svn co https://plugins.svn.wordpress.org/plugin-slug

If you already have the project, you can update to the latest version by doing

@ManiruzzamanAkash
ManiruzzamanAkash / BackupController.php
Last active January 21, 2023 01:33
DB backup controller laravel
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class BackupController extends Controller
{
public function exportDB(Request $request) {
$request->validate([