Skip to content

Instantly share code, notes, and snippets.

Avatar

Birgit Pauli-Haack bph

View GitHub Profile
@bph
bph / gist:fa359f27b12f8e3a87ce36d03090dde3
Created Jul 14, 2021
Issue 33436 / gutenberg theme.json
View gist:fa359f27b12f8e3a87ce36d03090dde3
{
"version": 1,
"settings": {
"layout": {
"contentSize": "800px",
"wideSize": "1000px"
},
"border": {
"customColor": false,
"customRadius": false,
@bph
bph / switch-states-sheets.txt
Created Feb 24, 2021
Switch Statement for Google Sheets - Replace US Statenames with 2-Letter Acroynym.
View switch-states-sheets.txt
=SWITCH(TRIM(AQ2), "Alabama","AL", "Alaska","AK","Arizona", "AZ", "Arkansas","AR","California", "CA","Colorado", "CO", "Connecticut","CT","Delaware","DE","Florida", "FL", "Georgia", "GA", "Hawaii","HI","Idaho","ID", "Illinois","IL","Indiana","IN","Iowa", "IA", "Kansas","KS", "Kentucky","KY","Louisiana", "LA","Maine","ME", "Maryland", "MD","Massachusetts","MA", "Michigan", "MI", "Minnesota", "MN", "Mississippi","MS","Missouri","MO","Montana","MT","Nebraska","NE", "Nevada","NV", "New Hampshire", "NH","New Jersey", "NJ", "New Mexico", "NM","New York", "NY", "North Carolina", "NC", "North Dakota","ND", "Ohio","OH", "Oklahoma","OK", "Oregon", "OR", "Pennsylvania","PA", "Rhode Island", "RI", "South Carolina","SC","South Dakota", "SD", "Tennessee", "TN","Texas", "TX", "Utah", "UT", "Vermont","VT","Virginia","VA", "Washington", "WA", "West Virginia","WV","Wisconsin","WI","Wyoming","WY",Trim(AQ2))
@bph
bph / content-block-team-member.php
Created May 17, 2019
Example code for ACF building blocks
View content-block-team-member.php
<?php
// create id attribute for specific styling
$id = 'team-member' . $block['id'];
// create align class ("alignwide") from block setting ("wide")
$align_class = $block['align'] ? 'align' . $block['align'] : '';
// Load values and asigning defaults for the block fields.
$short_bio = get_field('short_bio') ?: 'the short bio goes here... ';
$first_name = get_field('first_name') ?: 'First Name';
@bph
bph / team member theme's functions.php
Last active May 17, 2019
Example Code for using ACF building blocks
View team member theme's functions.php
function register_acf_blocks() {
// register a team member block.
acf_register_block(array(
'name' => 'acf-team-member',
'title' => __('ACF Team Member'),
'description' => __('A custom team member block created via ACF 5.8'),
'render_template' => 'content-block-team-member.php',
'category' => 'formatting',
'icon' => 'admin-comments',
@bph
bph / block-team-member.php
Last active May 16, 2019
Block Lab: Team Member block display
View block-team-member.php
<h2>
<?php block_field( 'first-name' );?>
<?php block_field( 'last-name' );?>
</h2>
<p><img class="teamphoto" src="<?php block_field( 'picture' ); ?>"
alt="<?php block_field( 'first-name' );?>
<?php block_field( 'last-name' );?> " width="150" style="float:left;padding:4px;margin;2px;"/>
<?php block_field( 'short-bio' ); ?></p>
<p><em>You can reach <?php block_field( 'first-name' );?></em>
View Cover Image Meetup Naples Sep 20 Invitation
{
"__file": "wp_block",
"title": "Cover image invitation",
"content": "<!-- wp:paragraph {\"align\":\"center\",\"customTextColor\":\"#ffffff\",\"backgroundColor\":\"luminous-vivid-orange\",\"customFontSize\":23} -->\n<p style=\"color:#ffffff;font-size:23px;text-align:center\" class=\"has-background has-luminous-vivid-orange-background-color\">Join your local WordPress Meetup!<br/></p>\n<!-- /wp:paragraph -->\n\n<!-- wp:cover-image {\"url\":\"http://rctesting.local/wp-content/uploads/2018/09/rawpixel-678089-unsplash-web.jpg\",\"id\":39,\"hasParallax\":true} -->\n<div class=\"wp-block-cover-image has-background-dim has-parallax\" style=\"background-image:url(http://rctesting.local/wp-content/uploads/2018/09/rawpixel-678089-unsplash-web.jpg)\"><p class=\"wp-block-cover-image-text\"><strong><strong><em>September, 20th at 6 pm ET<br/></em></strong><br/>Share your favorite Plugins &amp; Reusable Blocks for Content Creators<br/><em><br/>at VentureX, Mercato, Naples. </em></strong></p></div>\n<!-- /wp:cover-ima
@bph
bph / psl-theme-test.txt
Last active Oct 21, 2021
Blocks for Themes Test
View psl-theme-test.txt
<!-- 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
@bph
bph / psl-theme-test.txt
Created Jun 22, 2018
Blocks for Themes Test
View psl-theme-test.txt
<!-- wp:heading -->
<h2>Common Blocks / Formatting / Layout Elements / Widgets and Embeds</h2>
<!-- /wp:heading -->
<!-- wp:list -->
<ul>
<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">Button</a></li>
@bph
bph / weekly-block.css
Created Apr 17, 2018 — forked from pento/weekly-block.css
The Weekly Block
View weekly-block.css
/**
* License: GPL-3.0+
*/
.weekly-link {
/*border-left: 3px solid rgba(0,0,0,.8);*/
border-left: 3px solid rgba(255, 160, 0, 1);
padding-left: 2em;
padding-right: 2em;
margin-bottom: 2em;
}
@bph
bph / barcode4j.cfm
Created May 3, 2016 — forked from paulklinkenberg/barcode4j.cfm
barcode4j example in CFML / Lucee
View barcode4j.cfm
<cfset jarsPath = expandPath('/java/barcode4j/') />
<!--- Path where the necessary jar files are located (downloadable from https://www.dropbox.com/s/skl9fwky2n7mnjr/java-files-barcode4j.zip?dl=0) --->
<cfset libraryList = arrayToList( directoryList(jarsPath, false, 'array', '*.jar') ) />
<cfset configBuilder = createObject('java', 'org.apache.avalon.framework.configuration.DefaultConfigurationBuilder', libraryList) />
<cfset barcodeUtil = createObject('java', 'org.krysalis.barcode4j.BarcodeUtil', libraryList) />
<cfset grayImageType = createObject('java', 'java.awt.image.BufferedImage').TYPE_BYTE_GRAY />
<!--- create custom config. See http://barcode4j.sourceforge.net/2.1/symbol-ean-13.html --->
<cfset configXml = '<barcode>