Skip to content

Instantly share code, notes, and snippets.

View jeffcdavis's full-sized avatar
👨‍💻

Jeff Davis jeffcdavis

👨‍💻
View GitHub Profile
@Shpigford
Shpigford / .cursorrules
Last active April 25, 2025 01:22
Cursor Rules
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3
# Original original instructions: https://x.com/NickADobos/status/1814596357879177592
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code.
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices.
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning.
- Follow the user’s requirements carefully & to the letter.
@ravnoor
ravnoor / unraid_proftpd_sftp.sh
Last active January 14, 2023 19:26
unraid_proftpd_sftp.sh
# https://forums.unraid.net/topic/24356-proftpd-plugin-for-unraid-v68x/?do=findComment&comment=559588
# To enable sftp:
# open a shell on your unraid server and issue the following commands
cd /etc/ssh
ssh-keygen
# Enter the name of the keyfile (sftp_rsa_key) and no passphrase.
# You will get two files sftp_rsa_key and sftp_rsa_key.pub. The public
# key needs to be converted to another format to make it usable by
@vianhanif
vianhanif / form-validation-bootstrap-tab.html
Last active November 30, 2022 07:35
Custom form validation with Bootstrap 3 Tab navigation
<form class="form" action="#some-action">
<ul class="nav nav-tabs " role="tablist" id="tabs">
<li role="presentation" class="active">
<a class="Profil" href=".Profil" aria-controls="Profil" role="tab" data-toggle="tab">Profil</a>
</li>
<li role="presentation" class="">
<a class="Kontak" aria-controls="Kontak" role="tab" data-toggle="tab">Kontak</a>
</li>
<li role="presentation" class="">
<a class="Paspor" aria-controls="Paspor" role="tab" data-toggle="tab">Paspor</a>
@corsonr
corsonr / functions.php
Created September 28, 2016 08:33
Display WooCommerce product variations dropdown select on the shop page
<?php
// Display variations dropdowns on shop page for variable products
add_filter( 'woocommerce_loop_add_to_cart_link', 'woo_display_variation_dropdown_on_shop_page' );
function woo_display_variation_dropdown_on_shop_page() {
global $product;
if( $product->is_type( 'variable' )) {
@lukecav
lukecav / add-to-cart.php
Last active September 19, 2024 12:39
Display Product Variations in the Shop Loop - With Conditional Apply Filter Logic
<?php
/**
* Custom Loop Add to Cart.
*
* Template with quantity and ajax.
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
global $product;
<?php
class ACF_Product_Options {
static $slug = 'hwid_attributes';
public static function init() {
// Gather the global attribute types
$attribute_terms = wc_get_attribute_taxonomy_names();
@valfer
valfer / sendPush.txt
Last active April 29, 2024 12:29
Sending Push Notification with HTTP2 (and PHP) see entire post at: http://coding.tabasoft.it/ios/sending-push-notification-with-http2-and-php/
<?php
/**
* @param $http2ch the curl connection
* @param $http2_server the Apple server url
* @param $apple_cert the path to the certificate
* @param $app_bundle_id the app bundle id
* @param $message the payload to send (JSON)
* @param $token the token of the device
* @return mixed the status code (see https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH101-SW18)
@chrismccoy
chrismccoy / restapi.txt
Last active April 22, 2025 02:24
WordPress REST API Resources
Disable REST Api without Plugins
https://rudrastyh.com/wordpress/disable-rest-api.html
Add featured image & alt text to WP REST API
https://allisontarr.com/2021/10/13/add-featured-image-alt-text-to-wp-rest-api/
Allow ALL cross origin requests to WordPress REST API
https://github.com/Shelob9/rest-all-cors
WordPress theme using Rest API and Vue.js
@claudiosanches
claudiosanches / functions.php
Last active September 24, 2024 17:55
WooCommerce - Change ajax variation threshold
function custom_wc_ajax_variation_threshold( $qty, $product ) {
return 10;
}
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 );
@Yame-
Yame- / add-woocommerce-product.php
Last active December 6, 2022 17:14
Adding a WooCommerce product programmatically.
<?php
$args = array(
'post_author' => 1,
'post_content' => '',
'post_status' => "draft", // (Draft | Pending | Publish)
'post_title' => '',
'post_parent' => '',
'post_type' => "product"
);