Skip to content

Instantly share code, notes, and snippets.

View arshohag's full-sized avatar
🎯
Focusing

Ashiqur Rahman arshohag

🎯
Focusing
View GitHub Profile
@arshohag
arshohag / gist:35f0266328df694631105c54a3e56678
Created February 12, 2022 12:34 — forked from mikejolley/gist:3097073
WooCommerce - Unhook/Disable emails
/**
* Code goes in functions.php or a custom plugin.
*/
add_action( 'woocommerce_email', 'unhook_those_pesky_emails' );
function unhook_those_pesky_emails( $email_class ) {
/**
* Hooks for sending emails during store events
**/
@arshohag
arshohag / transitions.css
Created May 18, 2021 02:13 — forked from robsonsanches/transitions.css
Force Bootstrap v4 transitions (ignores prefers-reduced-motion media feature)
/*
* Force Bootstrap v4 transitions
* (ignores prefers-reduced-motion media feature)
* https://gist.github.com/robssanches/33c6c1bf4dd5cf3c259009775883d1c0
*/
.fade {
transition:opacity 0.15s linear !important;
}
.collapsing {
@arshohag
arshohag / mailgun-config.md
Last active February 4, 2021 07:59 — forked from mrabbani/mailgun-config.md
Laravel Mailgun Setup

Mailgun setup

  • install Guzzle HTTP library : composer require guzzlehttp/guzzle
  • [sign up to mailgun] (http://www.mailgun.com)
  • Go to Domains tab and click on domains
  • You will find the necessary data for .env setup
    • MAIL_DRIVER=mailgun
    • MAIL_HOST=smtp.mailgun.org
    • MAIL_PORT=587
    • MAIL_USERNAME=[email protected]
  • MAIL_PASSWORD=502fd951f7------------------------
@arshohag
arshohag / passwordValidation.php
Created October 2, 2020 09:58 — forked from Michael-Brooks/passwordValidation.php
Laravel Password validation Regex (Contain at least one uppercase/lowercase letters and one number)
<?php
/*
* Place this with the rest of your rules.
* Doesn't need to be in an array as there are no pipes.
* Password is required with a minimum of 6 characters
* Should have at least 1 lowercase AND 1 uppercase AND 1 number
*/
$rules = [
'password' => 'required|min:6|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/'
];
@arshohag
arshohag / API_STATUS
Created November 24, 2019 10:26 — forked from minhajul-islam/API_STATUS
List of HTTP status codes
export const API_STATUS = {
//1×× Informational
AS_100: {'CODE':100,'DES': 'Continue'},
AS_101: {'CODE':101,'DES': 'Switching Protocols'},
AS_102: {'CODE':102,'DES': 'Processing'},
//2×× Success
AS_200: {'CODE':200,'DES': 'OK'},
AS_201: {'CODE':201,'DES': 'Created'},
AS_202: {'CODE':202,'DES': 'Accepted'},
AS_203: {'CODE':203,'DES': 'Non-authoritative Information'},
@arshohag
arshohag / pdf-example.blade.php
Created May 15, 2019 06:43 — forked from alfredoem/pdf-example.blade.php
Template for a invoice render with DomPDF
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aloha!</title>
<style type="text/css">
* {
font-family: Verdana, Arial, sans-serif;
}
@arshohag
arshohag / index.php
Created March 3, 2019 08:36 — forked from ajitbohra/index.php
mpdf: HTML/CSS to PDF & send pdf via email
<?php
/*
mPDF: Generate PDF from HTML/CSS (Complete Code)
*/
require_once( 'mpdf/mpdf.php'); // Include mdpf
$stylesheet = file_get_contents('assets/css/pdf.css'); // Get css content
$html = '<div id="pdf-content">
Your PDF Content goes here (Text/HTML)
</div>';
@arshohag
arshohag / letsencrypt.sh
Created December 11, 2018 06:28 — forked from rraspo/letsencrypt.sh
Let's encrypt on an AWS EC2 instance with cronjob to automatically renew it.
#!/bin/bash
# I assume you already have port 443 open and ready to receive requests on your AWS security policies
# As well, I also assume you already have a valid domain pointing to your AWS EC2 instance, since Let's Encrypt does not verify EC2 instances without a domain name
YOUR_DOMAIN=xyz.com
YOUR_SERVER=apache
sudo yum update # Update your AMI dependencies
sudo yum install git, mod24_ssl, gcc
sudo pip install --upgrade pip # Upgrade your pip
cd /opt/
@arshohag
arshohag / php-interview.md
Created September 7, 2018 19:03 — forked from messified/php-interview.md
PHP Engineer Interview: What you should know

PHP Developer Interview: What you should know

###1. What’s the difference between " self " and " this " ?

Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.

Source: When to use self vs this -stackoverflow

@arshohag
arshohag / host-react-app-on-apache-server.md
Created May 22, 2018 13:12 — forked from ywwwtseng/host-react-app-on-apache-server.md
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production