Skip to content

Instantly share code, notes, and snippets.

@Mr2P
Mr2P / the-animated-title-block-scripts.js
Created December 21, 2022 00:53
The script for the animated title block
// https://cdn.jsdelivr.net/npm/splitting@1.0.6/dist/splitting.min.js
(() => {
const animatedClass = 'is-animated';
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
animateElement(entry.target, entry.isIntersecting);
});
}, {rootMargin: '0px'});
const animateElement = (element, isToggle) => {
@Mr2P
Mr2P / CBB - A simple toggle search icon
Last active October 18, 2022 10:07
CBB - A toggle search icon using Advanced Group block and SVG Block
<!-- wp:boldblocks/group {"className":"","boldblocks":{"width":{"sm":{"inherit":"lg"},"md":{"inherit":"lg"},"lg":{"value":{"width":"custom","value":"36px"},"inherit":null}},"height":{},"spacing":{},"overlay":{"opacity":100},"background":{},"textAlignment":{},"verticalAlignment":{},"justifyAlignment":{},"border":{"lg":{"value":{},"inherit":null},"md":{"inherit":"lg"},"sm":{"inherit":"lg"}},"enableEllipticalRadius":false,"borderRadius":{"lg":{"value":{},"inherit":null},"md":{"inherit":"lg"},"sm":{"inherit":"lg"}},"shadows":[],"transform":{"lg":{"value":[],"inherit":null},"md":{"inherit":"lg"},"sm":{"inherit":"lg"}},"transformOrigin":{},"animations":[],"animateMultipleTimes":false,"customCSS":{"value":"selector {\n\tcursor: pointer;\n}\nselector .close,\nselector .search {\n transition: opacity .15s;\n}\nselector .is-toggled-off .close,\nselector .search {\n opacity: 0;\n}\nselector .is-toggled-off .search,\nselector .close {\n opacity: 1;\n}\n","id":"IJvC6zkI5G"},"toggle":{"uniqueId":"1lvzSVz6La"}}} -->
<div
@Mr2P
Mr2P / CBB - a simple toggle menu icon
Last active October 18, 2022 01:31
CBB - A toggle menu icon using Advanced Group block and SVG Block
<!-- wp:boldblocks/group {"boldblocks":{"width":{"sm":{"inherit":"lg"},"md":{"inherit":"lg"},"lg":{"value":{"width":"custom","value":"36px"},"inherit":null}},"height":{"sm":{"inherit":"lg"},"md":{"inherit":"lg"},"lg":{"value":{"height":"custom","value":"36px"},"inherit":null}},"spacing":{},"overlay":{"opacity":100},"background":{},"textAlignment":{},"verticalAlignment":{},"justifyAlignment":{},"border":{},"enableEllipticalRadius":false,"borderRadius":{},"shadows":[],"transform":{},"transformOrigin":{},"toggle":{"uniqueId":"cpWFot6ucW"},"animations":[],"animateMultipleTimes":false,"customCSS":{"value":"selector svg .bar {\n transition: .3s;\n}\nselector svg .bar-1 {\n transform-origin: 50% 25%;\n}\nselector svg .bar-2 {\n transform-origin: center;\n}\nselector svg .bar-3 {\n transform-origin: 50% 75%;\n}\nselector .is-toggled-on .bar-2 {\n transform: scale(0);\n}\nselector .is-toggled-on .bar-1 {\n transform: translateY(25%) rotate(45deg);\n}\nselector .is-toggled-on .bar-3 {\n transform: translateY(-25
@Mr2P
Mr2P / gencert.sh
Last active December 1, 2017 02:46 — forked from bradland/gencert.sh
Generate a self-signed SSL cert
#!/bin/bash
# Bash shell script for generating self-signed certs. Run this in a folder, as it
# generates a few files. Large portions of this script were taken from the
# following artcile:
#
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html
#
# Additional alterations by: Brad Landers
# Date: 2012-01-27
@Mr2P
Mr2P / mail-test.php
Created April 19, 2017 16:09 — forked from Dreyer/mail-test.php
Quick & Dirty PHP Mail Test Script
<?php
/*
DONT FORGET TO DELETE THIS SCRIPT WHEN FINISHED!
*/
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = 'webmaster@example.com';
@Mr2P
Mr2P / bash-cheatsheet.sh
Created February 27, 2017 08:39 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
<?php
// clean up shortcode
function parse_shortcode_content( $content ) {
/* Parse nested shortcodes and add formatting. */
$content = trim( do_shortcode( shortcode_unautop( $content ) ) );
/* Remove '' from the start of the string. */
<?php
// clean up shortcode
function parse_shortcode_content( $content ) {
/* Parse nested shortcodes and add formatting. */
$content = trim( do_shortcode( shortcode_unautop( $content ) ) );
/* Remove '' from the start of the string. */
@Mr2P
Mr2P / Wordpress: Append span tag to each "tag item" returned from get_the_tag_list()
Created November 4, 2012 17:18
Wordpress: Append span tag to each "tag item" returned from get_the_tag_list()
$tags_list = get_the_tag_list( 'Tags: ', __( ', ', 'text_domain' ) );
preg_replace_callback('/<a\b[^>]*>(.*?)<\/a>/',create_function('$matches','return "$matches[1]";'),$tags_list);
preg_replace('/(<a\b[^>]*>)(.*?)(<\/a>)/', '$1<span class="tag-label">$2</span>$3', $tags_list);