Skip to content

Instantly share code, notes, and snippets.

View josephfusco's full-sized avatar
:octocat:
Building the web

Joe Fusco josephfusco

:octocat:
Building the web
View GitHub Profile
<iframe id="wp-playground" style="width: 100%; height: 100%" frameBorder="0"></iframe>
<script type="module">
import {
startPlaygroundWeb
} from 'https://unpkg.com/@wp-playground/client/index.js';
const client = await startPlaygroundWeb({
iframe: document.getElementById('wp-playground'),
remoteUrl: `https://playground.wordpress.net/remote.html`,
blueprint: {
landingPage: '/wp-admin/options-general.php?page=faustwp-settings',
@josephfusco
josephfusco / CustomToolbar.tsx
Last active February 24, 2023 18:04
Testing the ToolbarNodeSkeleton component with Faust.js.
import React from 'react';
import { FaustHooks, FaustPlugin } from '@faustwp/core';
import { FaustToolbarNodes, ToolbarNodeSkeleton } from '@faustwp/core/toolbar';
export class CustomToolbar implements FaustPlugin {
apply(hooks: FaustHooks) {
hooks.addFilter('toolbarNodes', 'faust', (toolbarNodes: FaustToolbarNodes) => {
const customToolbarNodes: FaustToolbarNodes = [
{
#!/usr/bin/env bash
# Exit if WP-CLI is not available.
if ! command -v wp &> /dev/null
then
echo "This script requires WP-CLI"
exit
fi
# Install WordPress plugins.
@josephfusco
josephfusco / input.scss
Created March 31, 2022 14:25
Generated by SassMeister.com.
.container {
width: (10/12) * 100%;
}
.container {
width: percentage(10/12);
}
@josephfusco
josephfusco / input.scss
Created December 3, 2020 15:24
Generated by SassMeister.com.
// My existing WordPress Project that requires MDL
// Assign namespace above MDL base-ui scss import.
// If no $namespace is assigned before importing MDL base-ui,
// no namespace is added.
$namespace: '#project-defined .specificity';
// Import single MDL scss file from within node_modules (Mimmick MDL import)
// @import "~@masonite/base-ui/styles/style.scss";
@josephfusco
josephfusco / input.scss
Created November 4, 2020 20:15
Generated by SassMeister.com.
.rating {
&__bar {
// Generate our rating__bar data selectors.
@for $i from 0 through 10 {
&[data-value="#{$i}"] {
&:before{
width: $i * 10%;
}
&:after{
left: $i * 10%;
<?php
/*
Valet driver for Wordpress Multisite
Usage: Drop this file into your ~/.valet/Drivers/ directory
*/
class WordPressMultisiteValetDriver extends WordPressValetDriver
{
/**
@josephfusco
josephfusco / bzexcluderules_editable.xml
Last active May 10, 2018 14:00 — forked from jsonmaur/bzexcluderules_editable.xml
Backblaze Custom Exclude - Located in `/Library/Backblaze.bzpkg/bzdata`
<!-- Keep unnecessary dev stuff out of backup -->
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.svn/" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/vendor/" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/bower_components/" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" doesNotContain="*" endsWith="*" hasFileExtension="*" />
#!/bin/bash
admin_email="hello@josephfus.co"
admin_username="admin"
admin_password="password"
db_prefix="demowp_"
sites_directory="$HOME/Demo"
# Create folder for site.
mkdir $sites_directory/$1 && cd $sites_directory/$1
@josephfusco
josephfusco / createsite.sh
Created November 18, 2017 15:52
Script that creates a new CNAME entry on a domain in DigitalOcean & creates a new ServerPilot application.
#!/bin/bash -e
DO_TOKEN_KEY="" # DigitalOcean token key
SP_CLIENTID="" # ServerPilot API Client ID
SP_APIKEY="" # ServerPilot API Key
SP_SYSUSERID="" # Systemuser ID for the specific server
PRODUCTION_ADMIN_USER="" # Your WordPress admin username
PRODUCTION_ADMIN_PASSWORD="" # Your WordPress admin user password
PRODUCTION_ADMIN_EMAIL="" # Your WordPress admin user email