Skip to content

Instantly share code, notes, and snippets.

View huntercox's full-sized avatar

Hunter Cox huntercox

View GitHub Profile
@mimukit
mimukit / SSH key setup.md
Last active October 11, 2024 11:38
Quick guide for SSH setup on macOS
  1. Setup ssh key on your pc (skip this step if you already have it)
    • Run this command with your email address instead of your_email@example.com .
    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    
    • Start the ssh-agent in the background.
    eval "$(ssh-agent -s)"
    
  • Add your SSH private key to the ssh-agent and store your passphrase in the keychain.
@devinsays
devinsays / example-ajax-enqueue.php
Last active October 1, 2025 22:15
Simple WordPress Ajax Example
<?php
function example_ajax_enqueue() {
// Enqueue javascript on the frontend.
wp_enqueue_script(
'example-ajax-script',
get_template_directory_uri() . '/js/simple-ajax-example.js',
array( 'jquery' )
);
@ollietreend
ollietreend / acf-php-to-json.php
Last active August 28, 2025 05:42
Convert Advanced Custom Fields Pro configuration from PHP to JSON.
<?php
/**
* Plugin Name: Convert ACF PHP to JSON
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON.
*/
namespace ConvertAcfPhpToJson;
/**
* Add submenu item under 'Custom Fields'
@jasewarner
jasewarner / gitignore-for-wordpress-theme
Last active August 2, 2025 22:09
WordPress project .gitignore
# ignore everything in the root except the "wp-content" directory.
/*
!wp-content/
# ignore everything in the "wp-content" directory, except the themes directories
wp-content/*
!wp-content/themes/
# ignore all mu-plugins, plugins, and themes
# unless explicitly whitelisted at the end of this file
@michaeldozark
michaeldozark / acf-states.txt
Last active October 4, 2021 16:31
State list for Advanced Custom Fields select field
AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
CT : Connecticut
DE : Delaware
DC : District of Columbia
FL : Florida
@mattclements
mattclements / function.php
Last active September 30, 2025 07:50
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}