Skip to content

Instantly share code, notes, and snippets.

View SeanChDavis's full-sized avatar
👋
Reach out.

Sean Christopher Davis SeanChDavis

👋
Reach out.
View GitHub Profile
@SeanChDavis
SeanChDavis / .bashrc
Created May 29, 2025 19:17
bashrc example
### COLORS {{{
NONE="\[\033[0m\]"
BK="\[\033[0;30m\]" #Black
EBK="\[\033[1;30m\]"
RD="\[\033[0;31m\]" #Red
ERD="\[\033[1;31m\]"
GR="\[\033[0;32m\]" #Green
EGR="\[\033[1;32m\]"
YW="\[\033[0;33m\]" #Yellow
@SeanChDavis
SeanChDavis / JavaExpressionsHW.java
Last active May 30, 2023 22:18
Basic Arithmetic Expressions in Java
/**
* Basic Expressions
*
* @author Sean Davis
*/
package edu.umsl;
import java.util.Scanner;
@SeanChDavis
SeanChDavis / file.php
Created March 21, 2020 14:52
Volatyl - Order download categories and tags alphabetically
<?php // DO NO COPY THIS LINE
/**
* Modify various queries
*
* @param $query
*/
function vol_custom_pre_get_posts( $query ) {
if ( is_admin() ) {
@SeanChDavis
SeanChDavis / file.php
Last active July 31, 2024 13:12
EDD - bulk edit variable price options more ALL downloads
<?php // DO NOT COPY THIS LINE
/**
* Bulk edit all downloads with variable price options
*
* This code should only be executed when needed. The purpose is to find
* all downloads with variable pricing, and update their respective variable
* pricing labels (Option Name) based strings given in the custom function.
*
* The easiest way to use the function is with the following WordPress plugins:
@SeanChDavis
SeanChDavis / file.php
Created January 2, 2020 16:58
Themedd copyright edit
<?php // DO NOT COPY THIS LINE
/**
* Filter the Themedd copyright text for custom output
*/
function custom_themedd_copyright( $copyright ) {
$copyright = 'Custom copyright &copy; text with year (' . date( 'Y' ) . ') and site name (' . get_bloginfo( 'name' ) . ')!' ;
@SeanChDavis
SeanChDavis / file.php
Created November 8, 2019 18:37
EDD checkout form - move login form to checkout cart (custom)
<?php // DO NOT COPY THIS LINE
// PLEASE READ ALL COMMENTS
/**
* This is being provide as-is directly from a custom implementation I built for the checkout form on easydigitaldownloads.com.
* It's not just this part that is custom. I made various changes to the entire checkout cart, form, and behavior. So context
* matters. The code below is specific to repositioning the login form, putting it behind a toggle link, and making sure the
* form still submits via AJAX. While this will get you most of the way, you'll have to make tweaks based on your own code.
*
@SeanChDavis
SeanChDavis / account-dashboard.php
Created September 16, 2019 19:22
EDD Site Account Dashboard page
<?php
/**
* Content for the Account Dashboard tab on the Account page / The Main Account Page
*/
global $current_user;
$customer = '';
if ( class_exists( 'Easy_Digital_Downloads' ) ) {
@SeanChDavis
SeanChDavis / file.php
Created December 16, 2017 19:37
FES show custom user meta on vendor order
<?php // DO NOT COPY THIS LINE
function sd_edd_fes_custom_user_meta( $payment ) {
$user = edd_get_payment_meta_user_info( $payment->ID );
?>
<tr>
<td><strong><?php _e( 'Phone', 'easy-digital-downloads' ); ?>:</strong></td>
<td><?php echo get_user_meta( $user['id'], 'phone_number', true ); ?></td>
</tr>
<?php
@SeanChDavis
SeanChDavis / file.php
Created September 9, 2017 19:07
EDD Checks Gateway Email Customization
<?php // DO NOT COPY THIS LINE
// Checks Gateway email subject adjustment
function sd_eddcg_custom_admin_notification_subject( $subject ) {
$subject = 'New Pending Offline Donation';
return $subject;
}
add_filter( 'eddcg_admin_purchase_notification_subject', 'sd_eddcg_custom_admin_notification_subject' );
// Checks Gateway email body adjustments
@SeanChDavis
SeanChDavis / file.php
Created August 31, 2017 19:28
EDD prevent duplicate cart items
<?php // DO NOT COPY THIS LINE
/**
* Prevents items from being added to the cart multiple times
*
*/
function pw_edd_prevent_duplicate_cart_items( $download_id, $options ) {
if( edd_item_in_cart( $download_id, $options ) ) {
if( edd_is_ajax_enabled() ) {
wp_redirect( edd_get_checkout_uri() ); exit;