Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tflight
tflight / tflight-act-escape-html-log-check.php
Created January 19, 2024 18:23
ACF Escape HTML Log Check
<?php
/**
* Plugin Name: ACF Escape HTML Log Check
* Description: Checks if the ACF Escape HTML Log has been triggered.
* Version: 1.0.0
* Requires at least: 6.0
* Requires PHP: 7.4
* Author: Tim Flight
* Author URI: https://github.com/tflight
@tflight
tflight / shippingeasy-woocommerce_rest_orders_prepare_object_query.php
Created August 31, 2023 18:50
When ShippingEasy sends API request for all orders, just show them orders in the custom status
<?php
/**
* When ShippingEasy sends API request for all orders, just show them orders in the custom status
*/
add_filter('woocommerce_rest_orders_prepare_object_query', 'shippingeasy_woocommerce_rest_orders_prepare_object_query', 10, 2);
function shippingeasy_woocommerce_rest_orders_prepare_object_query($args, $request)
{
@tflight
tflight / .htaccess
Last active May 2, 2020 14:44 — forked from bhubbard/.htaccess
This is my template .htaccess file for WordPress on Cloud Sites.
# Apache Server Config | MIT License
# https://gist.github.com/bhubbard/6082577
# Modified from https://github.com/h5bp/server-configs-apaches
# ##############################################################################
# # MIME TYPES AND ENCODING #
# ##############################################################################
# ------------------------------------------------------------------------------
# | ETag removal |
@tflight
tflight / boostrap-table-stack.scss
Last active April 15, 2020 15:59
Boostrap 4 Stackable Tables
.table-stack {
display: block;
}
.table-stack tr {
display: block;
}
.table-stack thead {
display: none;
@tflight
tflight / bootstrap-4-hover-cards.css
Last active March 27, 2020 15:29
Add an overlay to Bootstrap 4 cards with stretched links inside.
.card:hover .stretched-link::after{
background-color: rgba(0,0,0,0.3);
}
@tflight
tflight / responsive-column-count.scss
Created November 8, 2019 01:05
Responsive Column Count for Bootstrap 4
/**
* Responsive Column Counts with Bootstrap 4
* <div class="column-count-md-3">
* <p>Very long Lorem ipsum...</p>
* </div>
*/
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@tflight
tflight / responsive-bs4-borders.scss
Created November 6, 2019 20:46
Responsive Bootstrap 4 Borders
// @link https://github.com/twbs/bootstrap/issues/23892#issuecomment-396831166
@each $breakpoint in map-keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.border#{$infix}-top { border-top: $border-width solid $border-color ; }
.border#{$infix}-right { border-right: $border-width solid $border-color ; }
.border#{$infix}-bottom { border-bottom: $border-width solid $border-color ; }
.border#{$infix}-left { border-left: $border-width solid $border-color ; }
<?php
$mbox = imap_open("{mail.example.com:993/imap/ssl}", "username", "password");
if (!$mbox) {
echo 'fail';
}
echo 'success';
<?php
require __DIR__ . '/vendor/autoload.php';
$auth_factory = new \Aura\Auth\AuthFactory($_COOKIE);
$auth = $auth_factory->newInstance();
$imap_adapter = $auth_factory->newImapAdapter(
'{mail.example.com:993/imap/ssl}'
);
$loginService = $auth_factory->newLoginService($imap_adapter);
<?php
namespace App\Middleware;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use Slim\Views\Twig as View;
class SessionMiddleware
{