Skip to content

Instantly share code, notes, and snippets.

@sirreal
sirreal / blueprint.json
Created May 6, 2024 10:45
WP playground blueprint - Script Modules data sharing
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"landingPage": "/",
"phpExtensionBundles": [
"kitchen-sink"
],
"steps": [
{
"step": "mkdir",
"path": "/wordpress-new"
@sirreal
sirreal / Dockerfile.php7
Created February 6, 2024 11:53
Demo php clase name collision problems
FROM php:7.0-alpine
COPY . .
ENTRYPOINT ["php", "a.php"]
@sirreal
sirreal / index.html
Last active January 25, 2024 14:49
Test PR 58258
<body>
<div
data-wp-interactive='{"namespace":"jon/the-block"}'
data-wp-context='{"val":0}'
>
<input
readonly
type="number"
class="jon-val"
data-wp-bind--value="context.val"
@sirreal
sirreal / block.json
Last active January 24, 2024 15:03
Demo of viewScriptModule
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"title": "Jon's cool counter",
"name": "jon/the-block",
"editorScript": "file:./index.js",
"viewScriptModule": "file:./view.js",
"render": "file:./render.php",
"category": "text"
}
@sirreal
sirreal / block.json
Last active January 8, 2024 15:44
A simple WordPress block plugin with block.json viewModule
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"title": "Jon's cool counter",
"name": "jon/the-block",
"editorScript": "file:./index.js",
"viewModule": "file:./view.js",
"render": "file:./render.php",
"category": "text"
}
@sirreal
sirreal / Main.purs
Last active February 13, 2017 23:35
20 intermediate purescript exercises
module Main where
import Prelude
import Data.List
import Data.Either (Either(..))
import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype, unwrap)
import Data.Tuple (Tuple(..), fst, snd)
import Unsafe.Coerce (unsafeCoerce)
@sirreal
sirreal / README.md
Last active November 15, 2022 22:25
node-sass inline svgs via `svg()` function

Make it easy to include SVG strings inline via node-sass.

Escapes SVG (via encodeURIComponent + node-sass custom function).

Wraps <svg/> with appropriate url(data...) which I can never remember.

Call:

node-sass --source-map=true --functions=./node-sass-functions.js in.scss out.css
@sirreal
sirreal / keybase.md
Created April 29, 2014 10:00
keybase.md

Keybase proof

I hereby claim:

  • I am sirreal on github.
  • I am jonsurrell (https://keybase.io/jonsurrell) on keybase.
  • I have a public key whose fingerprint is D069 7BD1 B5F9 1620 86CC 28CA 818E F8F9 5177 8F28

To claim this, I am signing this object: