Skip to content

Instantly share code, notes, and snippets.

View joedooley's full-sized avatar

Joe Dooley joedooley

  • Florida
  • 21:09 (UTC -05:00)
View GitHub Profile
<?php
class ACF_File_Custom {
private static $instance;
public static function register() {
if ( self::$instance == null ) {
self::$instance = new ACF_File_Custom();
}
}
@joedooley
joedooley / gist:43dc50adab4c39d140f0d7cd86524078
Created December 10, 2016 00:28
FacetWP - variable products test
<?php
// Example - check for "in_stock" with a "Size" attribute
function show_instock_product_variations( $params, $class ) {
if ( 'tax/pa_size' == $params['facet_source'] && 'product' == get_post_type( $params['post_id'] ) ) {
WC()->api->includes();
WC()->api->register_resources( new WC_API_Server( '/' ) );
$response = WC()->api->WC_API_Products->get_product( $params['post_id'] );
$product = $response['product'];
@joedooley
joedooley / .gitignore
Created October 22, 2017 02:38 — forked from esamattis/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@joedooley
joedooley / wp-mailhog.php
Created January 14, 2018 00:26 — forked from bishless/wp-mailhog.php
Configure WordPress on Valet to use MailHog
<?php
/**
* @link
* @since 1.0.0
* @package TODO
*
* @wordpress-plugin
* Plugin Name: Use MailHog
* Description: Configure WordPress on Valet to use MailHog
* Version: 1.0.0
@joedooley
joedooley / gw-gravity-forms-manual-entries.php
Created February 8, 2018 02:33 — forked from spivurno/gw-gravity-forms-manual-entries.php
Gravity Wiz // Gravity Forms // 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.
*
* @version 1.2
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@joedooley
joedooley / functions.php
Created April 30, 2019 14:45 — forked from tripflex/functions.php
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 / Three Wise Monkeys.md
Created July 14, 2019 18:11 — forked from jesgs/Three Wise Monkeys.md
Three Wise Monkeys (NDA)

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@joedooley
joedooley / Contract Killer 3.md
Created July 14, 2019 18:17 — forked from jesgs/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@joedooley
joedooley / App.js
Created February 17, 2020 21:51 — forked from nvbn/App.js
Hooks with classes
import React from "react";
import Counter from "./Counter";
const App = () => {
return (
<div className="App">
<Counter initialCount={100} />
</div>
);
};
@joedooley
joedooley / localhost-ssl.sh
Created August 23, 2020 14:59 — forked from jonsamp/localhost-ssl.sh
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() {