Skip to content

Instantly share code, notes, and snippets.

View joedooley's full-sized avatar

Joe Dooley joedooley

  • Florida
  • 10:45 (UTC -04:00)
View GitHub Profile
@nodkz
nodkz / .babelrc.js
Last active March 25, 2024 16:16
Babel 7.0 with .babelrc.js DEPRECATED! This config was created when babel 7 was in beta
/* eslint-disable prefer-template */
const path = require('path');
const aliases = require('./aliases');
// ///////////////////////////////////////////////////////////////
// ////////////////// PLUGINS ////////////////////////////////
// ///////////////////////////////////////////////////////////////
const commonPlugins = [
@zackkatz
zackkatz / gravityview-trigger-gform_after_submission.php
Created June 19, 2017 19:09
GravityView - Trigger the `gform_after_submission` action when an entry is edited. This adds support for the Gravity Forms Zapier addon, for example.
<?php
/**
* GravityView doesn't trigger the `gform_after_submission` action when editing entries. This does that.
*
* @param array $form
* @param int $entry_id ID of the entry being updated
* @param GravityView_Edit_Entry_Render $object
*
* @return void
@jonsamp
jonsamp / localhost-ssl.sh
Created June 11, 2017 21:16
Create https key and cert on localhost
cd ~/
mkdir .localhost-ssl
sudo openssl genrsa -out ~/.localhost-ssl/localhost.key 2048
sudo openssl req -new -x509 -key ~/.localhost-ssl/localhost.key -out ~/.localhost-ssl/localhost.crt -days 3650 -subj /CN=localhost
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.localhost-ssl/localhost.crt
npm install -g http-server
echo "
function https-server() {
@zackkatz
zackkatz / gf-import-entries-send-notifications.php
Created May 4, 2017 18:43
Gravity Forms Import Entries - Send notifications for each imported entry
<?php
add_action( 'gform_post_add_entry', 'gv_import_entry_send_notifications', 10, 2 );
/**
* Send notifications
*
* @param $entry
* @param $form
*/
@zackkatz
zackkatz / gravityview-keep-hidden-fields-hidden.php
Created March 14, 2017 06:48
GravityView - Don't turn hidden fields into text fields in Edit Entry
<?php
add_action( 'gravityview_edit_entry', 'gravityview_dont_show_hidden_fields', 20 );
/**
* Don't turn hidden fields into text fields in GravityView Edit Entry
*/
function gravityview_dont_show_hidden_fields() {
if( ! class_exists('GravityView_Fields' ) ) {
@tripflex
tripflex / functions.php
Last active February 13, 2024 19:03
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
<?php
/**
* Make sure the function does not exist before defining it
*/
if( ! function_exists( 'remove_class_filter' ) ){
/**
* Remove Class Filter Without Access to Class Object
*
* In order to use the core WordPress remove_filter() on a filter added with the callback
@joedooley
joedooley / global-search-and-replace-query.sql
Last active August 23, 2021 16:56
SQL query that Find's all old URL's and Replaces with new URL values. This can be ran from phpmyadmin, etc... https://wpbeaches.com/updating-wordpress-mysql-database-after-moving-to-a-new-url/
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@joedooley
joedooley / pulling-remote-site-copy-into-a- vagrant-vm
Created December 26, 2015 07:06
From https://tomjn.com/2014/03/01/wordpress-bash-magic/ Pulling Down a Remote site Copy Into a Vagrant VM I use something similar to this to pull down this website into a Virtual machine automatically. If you use password authentication to log into your server rather than SSH Keys, or your using SFTP details, you’ll be prompted for it. If you us…
#!/bin/sh
### SSH Info ###
SUSER="serverusername";
SHOST="example.com";
SDIR="/srv/www/example.com";
echo 'starting rsync'
rsync -e "/usr/bin/ssh" --compress --stats -rlDHS $SUSER@$SHOST:$SDIR /srv/www/example.com
@spivurno
spivurno / gw-gravity-forms-manual-entries.php
Last active February 21, 2023 20:45
Gravity Wiz // Gravity Forms // Manual Entries
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-manual-entries.php
*/
/**
* Gravity Wiz // Gravity Forms // Manual Entries
*
* Create entries manually for Gravity Forms. Adds an "Add New" button next to the page title on all entry-related pages.
@davidneedham
davidneedham / .bash_profile
Last active March 17, 2016 13:06
Pantheon Development Workflow (pdw): Commands to improve your Pantheon to local development experience. Just copy these commands into your .bash_profile or .bashrc, update the pdw-auth command to use your credentials, install Terminus (https://github.com/pantheon-systems/cli/wiki/Installation), and go!
#------------------------------------------
# PANTHEON DEVELOPMENT WORKFLOW v1.01
# Using the Pantheon CLI (terminus) v0.71
#------------------------------------------
# Authenticate with Pantheon. The first step, most of the time.
# This is a little insecure, as it lists your password here. But it's convenient.
alias pdw-auth='terminus auth login YOURPANTHEONEMAILADDRESS --password=YOURPANTHEONPASSWORD'
# Update your local Pantheon site aliases