- 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------------------------
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 | |
**/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Force Bootstrap v4 transitions | |
* (ignores prefers-reduced-motion media feature) | |
* https://gist.github.com/robssanches/33c6c1bf4dd5cf3c259009775883d1c0 | |
*/ | |
.fade { | |
transition:opacity 0.15s linear !important; | |
} | |
.collapsing { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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).+$/' | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Aloha!</title> | |
<style type="text/css"> | |
* { | |
font-family: Verdana, Arial, sans-serif; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/ |
###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
NewerOlder