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
(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++) {
@josephfusco
josephfusco / gist:1e74cc3ae51496bc47629c6a7c5f5f35
Last active July 24, 2017 22:32
Using grep to assist with finding key words in code that could possibly be problematic. (WPCampus 2017 CampusPress code review presentation)
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' .
@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
#!/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 / 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="*" />
<?php
/*
Valet driver for Wordpress Multisite
Usage: Drop this file into your ~/.valet/Drivers/ directory
*/
class WordPressMultisiteValetDriver extends WordPressValetDriver
{
/**
@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%;
@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 / compiled.css
Last active January 25, 2022 20:36
iMessage Typing Indicator
.typing-indicator {
background-color: #E6E7ED;
width: auto;
border-radius: 50px;
padding: 20px;
display: table;
margin: 0 auto;
position: relative;
-webkit-animation: 2s bulge infinite ease-out;
animation: 2s bulge infinite ease-out;
@josephfusco
josephfusco / input.scss
Created March 31, 2022 14:25
Generated by SassMeister.com.
.container {
width: (10/12) * 100%;
}
.container {
width: percentage(10/12);
}