Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Joseph Fusco josephfusco

🏠
Working from home
View GitHub Profile
View WordPressMultisiteValetDriver.php
<?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 — forked from jsonmaur/bzexcluderules_editable.xml
Backblaze Custom Exclude - Located in `/Library/Backblaze.bzpkg/bzdata`
View bzexcluderules_editable.xml
<!-- 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="*" />
View create-site.sh
#!/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 Nov 18, 2017
Script that creates a new CNAME entry on a domain in DigitalOcean & creates a new ServerPilot application.
View createsite.sh
#!/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
@josephfusco
josephfusco / gist:1e74cc3ae51496bc47629c6a7c5f5f35
Last active Jul 24, 2017
Using grep to assist with finding key words in code that could possibly be problematic. (WPCampus 2017 CampusPress code review presentation)
View gist:1e74cc3ae51496bc47629c6a7c5f5f35
grep -nr 'file_get_contents\|wp_remote_\|wp_feed_cache_transient_lifetime\|base64_decode\|SHOW TABLES\|WP_DEBUG\|error_reporting\|display_errors\|scream.enabled\|rewrite_rules\|flush_rules\|googlesyndication.com\|remove_role\|ALLOW_EXTERNAL\|ofc_upload_image.php\|woothemes_framework_update_head\|wpdb\|CURLOPT_CONNECTTIMEOUT\|WPCom_Theme_Updater\|dbDelta\|mysql_connect\|wp_mkdir_p\|wp_cache_flush\|wp_clean_plugins_cache\|wp_cache_delete\|do_shortcode\|switch_to_blog' .
View demo-31JAN17.js
(function($) {
$(document).ready(function() {
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
View console.js
// generates Upfront child theme icon font code from https://icomoon.io/app/#/select/font
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
setTimeout(function(){
var $=jQuery.noConflict();
var icons = [];
$(".glyph .unitRight input").each(function(){icons.push($(this).val());});
var iconsString = '\'font_icons\' => \'["'+icons.join('", "')+'"]\',';
console.log('%c Copy & paste everything below in red into your child themes settings.php array: ', 'color: #69c07b');
View div-extended.php
<?php
/**
* Divi modifications to the new Divi PageBuilder
*/
function my_cutom_et_modules() {
if( class_exists("ET_Builder_Module") ){
class ET_Builder_Module_Image_2 extends ET_Builder_Module {
View center-codepen.css
html {
display: table;
width: 100%;
height: 100%;
}
body {
display: table-cell;
vertical-align: middle;
text-align: center;
@josephfusco
josephfusco / screenshots.js
Created Mar 24, 2016 — forked from nhoizey/screenshots.js
Take screenshots at different viewport sizes using CasperJS
View screenshots.js
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();
You can’t perform that action at this time.