Skip to content

Instantly share code, notes, and snippets.

@tflight
tflight / .htaccess
Last active May 2, 2020 — forked from bhubbard/.htaccess
This is my template .htaccess file for WordPress on Cloud Sites.
View .htaccess
# 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 Apr 15, 2020
Boostrap 4 Stackable Tables
View boostrap-table-stack.scss
.table-stack {
display: block;
}
.table-stack tr {
display: block;
}
.table-stack thead {
display: none;
@tflight
tflight / bootstrap-4-hover-cards.css
Last active Mar 27, 2020
Add an overlay to Bootstrap 4 cards with stretched links inside.
View bootstrap-4-hover-cards.css
.card:hover .stretched-link::after{
background-color: rgba(0,0,0,0.3);
}
@tflight
tflight / responsive-column-count.scss
Created Nov 8, 2019
Responsive Column Count for Bootstrap 4
View responsive-column-count.scss
/**
* 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 Nov 6, 2019
Responsive Bootstrap 4 Borders
View responsive-bs4-borders.scss
// @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 ; }
View php-imap.php
<?php
$mbox = imap_open("{mail.example.com:993/imap/ssl}", "username", "password");
if (!$mbox) {
echo 'fail';
}
echo 'success';
View aura-imap.php
<?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);
View SessionMiddleware.php
<?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
{
@tflight
tflight / ViewMiddleware.php
Created Nov 1, 2016
Twig View middleware invokable class to add common attributes to Slim's Twig View
View ViewMiddleware.php
<?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 ViewMiddleware
{
You can’t perform that action at this time.