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
@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([
@ManiruzzamanAkash
ManiruzzamanAkash / mysql-table-sizes-of-database.sql
Created July 15, 2022 11:26
Get a database full tables and their size in MB
-- Database:cart_pulse
SELECT
TABLE_NAME AS `Table`,
ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)`
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = 'cart_pulse'
ORDER BY
-- Create Primary Key
CREATE TABLE primary_test(
ID int PRIMARY KEY
);
-- Create Primary Key Multiple
CREATE TABLE primary_test(
ID INT NOT NULL,
EMAIL VARCHAR(50) NOT NULL,
@ManiruzzamanAkash
ManiruzzamanAkash / WordPress-Plugin-Release-Github-WordPress.MD
Last active May 12, 2022 04:07
WordPress Plugin Release using Github and WordPress

WordPress Plugin Release using Github and WordPress

Step 1: Cloning & Checking out

  • Clone the repository, checkout to develop
  • git pull for any latest changes

Step 2: Git flow

  • Make sure to have git flow installed
  • Run git flow init
  • Run git flow release start [ version should be incremented by 1 from the last release ]
@ManiruzzamanAkash
ManiruzzamanAkash / tailwind-card-component.html
Created April 3, 2022 04:45
Product Card Component Design using Tailwind CSS
<div class="p-5 bg-gray-100 text-center">
<!-- Card Design -->
<div class="bg-white w-64 m-5 py-5 transition shadow hover:shadow-lg border">
<img src="https://api-ecom.allgeneration.com/public/images/products/product-short-resolution-163-1632306571.png" class="w-full transition scale-[95%] hover:scale-100 delay-300" />
<h2 class="pt-4">
Samsung Gallaxy J10
</h2>
<p>
<span class="text-yellow-500">100TK</span>
@ManiruzzamanAkash
ManiruzzamanAkash / Git commands Lines of Code and Commit.git
Last active March 31, 2022 09:05
Git commands Lines of Code and Commit For a Year Range
// Get Commit for a Year ==> 2021 Jan 01 to 2021 Dec 31
git rev-list --all --count --since="01 Jan 2021" --before="31 Dec 2021"
// Get Lines of Code for a Year ==> 2021 Jan 01 to 2021 Dec 31
git log --since=2021-01-01 --until=2021-12-31 --format= --numstat | awk '{s+=$1; s+=$2} END {print s}'
// Get Lines of Code for a repository File by File
git ls-files | xargs file | grep "ASCII" | cut -d : -f 1 | xargs wc -l
@ManiruzzamanAkash
ManiruzzamanAkash / welcome.blade.php
Created March 19, 2022 09:56
SMS Portal With Twilio and Laravel
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SMS Portal With Twilio</title>
<!-- Styles -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
@ManiruzzamanAkash
ManiruzzamanAkash / web.php
Created March 19, 2022 09:54
Laravel + Twilio SMS integration routes file
<?php
use App\Http\Controllers\HomeController;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|