Skip to content

Instantly share code, notes, and snippets.

@geoffyuen
geoffyuen / gutenberg-sample-content.html
Created June 8, 2024 13:46 — forked from mailenkno/gutenberg-sample-content.html
WordPress Gutenberg Sample Content
<!-- wp:paragraph {"align":"center","customTextColor":"#000000","backgroundColor":"very-light-gray","fontSize":"small"} -->
<p style="color:#000000;text-align:center" class="has-background has-small-font-size has-very-light-gray-background-color">Gutenberg Sample Content.<br/>Put together with ❤️ by <a href="https://artisanthemes.io/">Artisan Themes</a>.</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":1} -->
<h1>This is a heading (H1)</h1>
<!-- /wp:heading -->
<!-- wp:heading -->
<h2>This is a heading (H2)</h2>
@geoffyuen
geoffyuen / my-plugin.php
Last active June 3, 2024 18:45
For REST API, when requesting a post, create an array to the blocks and also evaluate the ACF fields
<?php
// This doesn't really work just yet
add_action(
'rest_api_init',
function () {
if (!function_exists('use_block_editor_for_post_type')) {
require ABSPATH . 'wp-admin/includes/post.php';
}
@geoffyuen
geoffyuen / mames.sh
Created April 1, 2021 17:30
dumb ia-rcade menu for bash
mames(){
ls -l ~/mame/roms
local IFS=$'\n'
echo "Search for: "
read inp
echo .
local PS3="Type a number: "
select file in $(mame -listfull|grep -i "$inp")
do
# get first word from selected string/line using awk
@geoffyuen
geoffyuen / impose_pdf.md
Last active March 28, 2021 17:35
Impose a pdf for free

Debian:

sudo apt install texlive-latex-base
sudo apt install texlive-extra-utils

MacOS Homebrew (untested):

@geoffyuen
geoffyuen / input.scss
Created January 28, 2021 04:48
Generated by SassMeister.com.
@function cfg($key, $map: $cfg) {
@return map-get($map, $key);
}
$tach:(
values: (
0: 0,
1: 1px,
2: 2px,
),
rules: (
@geoffyuen
geoffyuen / input.scss
Last active January 25, 2021 04:39
Tailwind/Tachyons genrerator in pure Sass.
@function cfg($key, $map: $cfg) {
@return map-get($map, $key);
}
$cfg: (
whitespace: (
values: (
0: 0,
1: 1px,
@geoffyuen
geoffyuen / noJQuery.md
Last active April 6, 2020 18:54
No JQuery

Vue or Vanilla replacements for JQuery plugins

Old Replacement
$.animate Velocity.js
slick.js
@geoffyuen
geoffyuen / SassMeister-input.scss
Last active December 13, 2019 15:41
Sass/css - width from browser edge to grid system column
// Calculates the width of something that hugs the browser edge
// to a column inside a grid system with a max-width (Tachyons)
.sideimg {
$mw: 1920px; // max-width of container
$col: 40; // tach col width in percentage
// this doesn't evaluate
width: calc( 50% + ( -$mw / 2 + $mw * $col/100 ) );
@geoffyuen
geoffyuen / _webp.twig
Last active May 12, 2020 12:36
Webp with fallback for Timber/Twig
{% spaceless %}
{#
This Timber twig will output an <picture> with fallbacks, srcset x2, alt, width and height
Usage:
`{% include '_webp.twig' with { class: "db ma0 center w-100", img: Image(post.acf_image), w: 507, h: 507 } %}`
@params