Table of Contents generated with DocToc
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
{ | |
// The plugin looks for a .jsbeautifyrc file in the same directory as the | |
// source file you're prettifying (or any directory above if it doesn't exist, | |
// or in your home folder if everything else fails) and uses those options | |
// along the default ones. | |
// Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options | |
// Documentation: https://github.com/einars/js-beautify/ | |
"html": { | |
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "dust"], |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
- There are always 24 hours in a day.
- February is always 28 days long.
- Any 24-hour period will always begin and end in the same day (or week, or month).
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
# WordPress S3 Backup Script | |
# --------------------------------------------------------------------------------- | |
#!/bin/bash | |
bucket="s3://" # Your S3 Bucket | |
if [ -z "$1" ] | |
then | |
path=$PWD | |
else |
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
import gql from 'graphql-tag' | |
import { client } from '../utils/apollo-client' | |
const { parse } = wp.blocks; | |
const { select, subscribe, dispatch } = wp.data; | |
const GET_PAGE_BLOCK_TEMPLATE = gql` | |
query GET_PAGE_BLOCK_TEMPLATE($id: ID!, $template: String) { | |
page( id: $id ) { | |
blockTemplate( pageTemplate: $template ) | |
} | |
} |
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
<!-- wp:paragraph --> | |
<p><a href="https://gist.github.com/bph/335ddef358bb41efdcd159cbc76f582e">https://gist.github.com/bph/335ddef358bb41efdcd159cbc76f582e</a></p> | |
<!-- /wp:paragraph --> | |
<!-- wp:heading {"className":"eplus-oOhLNH"} --> | |
<h2 class="eplus-oOhLNH">Common Blocks / Formatting / Layout Elements / Widgets and Embeds</h2> | |
<!-- /wp:heading --> | |
<!-- wp:list {"className":"eplus-eI3gin"} --> | |
<ul class="eplus-eI3gin"><li><a href="#images">Images</a> (Single image, cover image, gallery </li><li><a href="#quotes">Pull Quote / Quote</a></li><li><a href="#verse">Verse</a></li><li><a href="#buttons">Buttons</a></li><li><a href="#socialicons" data-type="internal" data-id="#socialicons">Social Icons</a></li><li><a href="#columns">Columns </a> Text (only) columns / Columns experimental</li><li><a href="#cover" data-type="internal" data-id="#cover">Cover</a> with CAT + button</li><li><a href="#paragraphs">Paragraph</a> </li><li><a href="#audio">Audio</a> </li><li><a href="#video">Video</a></li><li><a href="#w |
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 | |
declare( strict_types=1 ); | |
/* | |
* Plugin Name: Demo App Passwords Client | |
*/ | |
namespace TimothyBJacobs\AppPasswordsClientDemo; | |
const META_KEY = '_app_passwords_client_demo_creds'; |
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
{ | |
"schema": "https://schemas.wp.org/trunk/theme.json", | |
"version": 2, | |
"settings": { | |
"layout": { | |
"contentSize": "800px", | |
"wideSize": "1000px" | |
}, | |
"color": { | |
"link": false |
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 | |
$default_attachment_url = get_stylesheet_directory_uri() . '/assets/images/default-cover-bg.jpg'; | |
$block_pattern_content = '<!-- wp:cover {"url":"' . esc_url( $default_attachment_url ) . '","id":42,"dimRatio":90,"minHeight":0,"minHeightUnit":"px","gradient":"vivid-cyan-blue-to-vivid-purple","align":"full","style":{"spacing":{"padding":{"top":"5rem","right":"14rem","bottom":"5rem","left":"14rem"}}}} --> | |
<div class="wp-block-cover alignfull" style="padding-top:5rem;padding-right:14rem;padding-bottom:5rem;padding-left:14rem;min-height:0px"> | |
<span aria-hidden="true" class="has-background-dim-90 wp-block-cover__gradient-background has-vivid-cyan-blue-to-vivid-purple-gradient-background has-background-dim has-background-gradient"></span> | |
<img class="wp-block-cover__image-background wp-image-42" alt="" src="' . esc_url( $default_attachment_url ) . '" data-object-fit="cover"/> | |
<div class="wp-block-cover__inner-container"> | |
<!-- wp:heading {"textAlign":"center","level":4,"style":{"spacing":{"margin":{"top" |
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 | |
/** | |
* Get an SVG file from the imgs/ folder in the theme, update its attributes if necessary and return it as a string. | |
* | |
* @author Aurooba Ahmed | |
* @see https://aurooba.com/inline-svgs-in-your-wordpress-code-with-this-helper-function/ | |
* | |
* @param string $filename The name of the SVG file to get. | |
* @param array $attributes (optional) An array of attributes to add/modify to the SVG file. |
OlderNewer