Skip to content

Instantly share code, notes, and snippets.

View jimboobrien's full-sized avatar

Jimobrien jimboobrien

View GitHub Profile
@patelnav
patelnav / mdc.mdc
Last active April 25, 2025 11:12
MDC file to help generate MDC files
---
description: Guidelines and best practices for creating .mdc (Markdown Configuration) files in Cursor, including structure, metadata annotations, and formatting rules
globs: ["**/*.mdc"]
---
# Cursor MDC File Guidelines
@context {
"type": "documentation",
"purpose": "cursor_rules",
@alexmustin
alexmustin / functions.php
Created April 25, 2019 23:42
PHP function to Convert Hex Colors to RGBA
<?php
//* Function to convert Hex colors to RGBA
function hex2rgba( $color, $opacity = false ) {
$defaultColor = 'rgb(0,0,0)';
// Return default color if no color provided
if ( empty( $color ) ) {
return $defaultColor;
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active April 11, 2025 08:17
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@gstricklind
gstricklind / functions.php
Last active January 25, 2018 01:38
Add data attribute with variable term_id to wp_list_categories
<?php
/*========================================================================
Filter wp_list_categories to add new attribute
========================================================================*/
add_filter('wp_list_categories','moons_ajax_onclick');
function moons_ajax_onclick($output){
//if (is_post_type_archive('crew')) { // localize this filter if needed
//if not using a CPT then change get_terms to get_categories
/*
* Load More for Masonry modification
*
* Full post:
* http://www.billerickson.net/infinite-scroll-in-wordpress/
*
*/
jQuery(function($){
@carasmo
carasmo / example-cmb2-repeatable-group.txt
Last active June 21, 2022 01:42
example CMB2 repeatable group
/** ====================================================================================
* Functions file
==================================================================================== **/
function yourthemeprefix_yourcpt_metabox_register() {
$prefix = '_cmb_';
@lots0logs
lots0logs / functions.php
Created December 18, 2015 01:10
Divi - Custom Sidebar For WooCommerce Pages
<?php /* Don't include this line if your child theme functions.php already includes it */
function my_et_divi_output_content_wrapper_end() {
echo '</div> <!-- #left-area -->';
if (
( is_product() && 'et_full_width_page' !== get_post_meta( get_the_ID(), '_et_pb_page_layout', true ) )
||
( ( is_shop() || is_product_category() || is_product_tag() ) && 'et_full_width_page' !== et_get_option( 'divi_shop_page_sidebar', 'et_right_sidebar' ) )
) {
dynamic_sidebar( 'eCommerce Sidebar' );
@cferdinandi
cferdinandi / terminal-cheat-sheet.txt
Last active April 8, 2025 13:14
Terminal Cheat Sheet
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@dstroot
dstroot / app.js
Created July 13, 2014 16:29
Gulp, BrowserSync, Node, and Nodemon all working in harmony. ;)
/**
* World's simplest express server
* - used to serve index.html from /public
*/
var express = require('express');
var serveStatic = require('serve-static');
var app = express();
app.use(serveStatic(__dirname + '/public'));
<?php
//* Do NOT include the opening php tag
//* Enqueue Animate.CSS and WOW.js
add_action( 'wp_enqueue_scripts', 'sk_enqueue_scripts' );
function sk_enqueue_scripts() {
wp_enqueue_style( 'animate', get_stylesheet_directory_uri() . '/css/animate.min.css' );
wp_enqueue_script( 'wow', get_stylesheet_directory_uri() . '/js/wow.min.js', array(), '', true );