Skip to content

Instantly share code, notes, and snippets.

View liamstewart23's full-sized avatar
🤓
Hello World!

Liam Stewart liamstewart23

🤓
Hello World!
View GitHub Profile
@liamstewart23
liamstewart23 / Login.php
Created November 15, 2023 01:18 — forked from marcguyer/Login.php
Zend Framework V1 fix for TLS1.2 using Zend_Mail_Transport_Smtp
<?php
class My_Mail_Protocol_Smtp_Auth_Login extends My_Mail_Protocol_Smtp
{
/**
* LOGIN username
*
* @var string
*/
protected $_username;
Header always set X-Frame-Options SAMEORIGIN
Header always set X-XSS-Protection 1;mode=block
Header always set X-Content-Type-Options nosniff
Header always edit Set-Cookie ^(.*)$ $1;Secure env=HTTPS
Header always set Strict-Transport-Security "max-age=15552000; includeSubdomains;" env=HTTPS
Header always set Referrer-Policy: strict-origin-when-cross-origin
Header always set Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()"
#Header set Content-Security-Policy "default-src 'self' https:;"
<Location "/">
Header unset ETag
FileETag None
Header set Connection keep-alive
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/svg "access 1 year"
ExpiresByType text/css "access 1 month"
@liamstewart23
liamstewart23 / wpms-smtp-disable-ssl-verify.php
Created October 15, 2021 20:24 — forked from slaFFik/wpms-smtp-disable-ssl-verify.php
WP Mail SMTP: when using SMTP mailer - disable SSL verify on PHP 5.6+
<?php
add_filter('wp_mail_smtp_custom_options', function( $phpmailer ) {
$phpmailer->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);

How to install mysql on ubuntu (which works)

first delete it in case a root password was previously created:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean

then install it:

<?php
/**
*
* Plugin Name: CF7 to Webhook - Add Cookies
* Description: Add Cookies data to webhook
* Version: 1.0.0
* Author: Mário Valney
* Author URI: https://mariovalney.com
* Text Domain: cf7-to-webhook-add-cookies
*/
@liamstewart23
liamstewart23 / admin.css
Last active April 21, 2021 14:52 — forked from prasetyop/admin.css
Flexible Content Preview Pop Up
.acf-fc-popup .preview {
position: absolute;
right: 100%;
margin-right: 0px;
top: 0;
background: #383c44;
min-height: 100%;
border-radius: 5px;
align-content: center;
display: grid;
@liamstewart23
liamstewart23 / HOWTO.md
Created March 19, 2021 20:25 — forked from ivanvermeyen/HOWTO.md
Multiple MySQL versions on MacOS with Homebrew

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@liamstewart23
liamstewart23 / dl-file.php
Created March 4, 2021 15:57 — forked from hakre/dl-file.php
Wordpress login to download uploaded files
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
*
* @author hakre <http://hakre.wordpress.com/>
* @license GPL-3.0+
@liamstewart23
liamstewart23 / tickets.php
Created January 6, 2021 04:30 — forked from imath/tickets.php
Using WP Statuses for custom Post Types.
<?php
/**
* Using WP Statuses for custom Post Types.
*
* @link http://github.com/imath/wp-statuses
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;