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
@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' .
(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++) {
// 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');
<?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 {
html {
display: table;
width: 100%;
height: 100%;
}
body {
display: table-cell;
vertical-align: middle;
text-align: center;
@josephfusco
josephfusco / screenshots.js
Created March 24, 2016 01:52 — forked from nhoizey/screenshots.js
Take screenshots at different viewport sizes using CasperJS
/*
* 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();
@josephfusco
josephfusco / theme-unit-test-data.xml
Created March 22, 2016 02:09
WordPress Theme Unit Test Data
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is a WordPress eXtended RSS file generated by WordPress as an export of your site.
It contains information about your site's posts, pages, comments, categories, and other content.
You may use this file to transfer that content from one site to another.
This file is not intended to serve as a complete backup of your site.
To import this information into a WordPress site follow these steps:
1. Log in to that site as an administrator.
2. Go to Tools: Import in the WordPress admin panel.
@josephfusco
josephfusco / .sh
Last active February 12, 2016 20:57
resetwp(){
cwd=$(pwd)
cd ~/vagrant-local/www
vagrant ssh -c "cd /srv/www/wordpress-default/
rm -rf wp-content/uploads
wp reset database
wp rewrite structure '/%postname%/
cd $cwd'
}
html {
display: table;
width: 100%;
height: 100%;
}
body {
display: table-cell;
vertical-align: middle;
text-align: center;
@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;