Skip to content

Instantly share code, notes, and snippets.

View oneblackcrayon's full-sized avatar

Frederick Polk oneblackcrayon

View GitHub Profile
@oneblackcrayon
oneblackcrayon / gridrotator.js
Created March 24, 2025 04:17
gridrotator.js v1.1.0
/**
* jquery.gridrotator.js v1.1.0
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2012, Codrops
* http://www.codrops.com
*/
# brew "node@10"
# brew "node@12"
# brew "node@14"
# brew "php@7.4"
tap "buo/cask-upgrade"
tap "dart-lang/dart"
tap "hacker1024/hacker1024"
tap "heroku/brew"
tap "homebrew-ffmpeg/ffmpeg"
tap "homebrew/bundle"
@oneblackcrayon
oneblackcrayon / stripe_copy.php
Created July 16, 2024 00:12 — forked from mrubiosan/stripe_copy.php
Migrate Stripe Products and Plans
<?php
$fromToken = 'rk_live_abc';
$toToken = 'rk_test_def';
$prodContext = stream_context_create([
'http' => [
'header' => "Authorization: Bearer $fromToken\r\n"
]
]);
$testContext = stream_context_create([
<?php
/**
* Plugin Name: WooCommerce Custom Account Tabs
* Plugin URI: https://www.example.com/
* description: PHP Class to generate new account tabs for WooCommerce My Account page
* Version: 1.0
* Author:
* Author URI: https://gist.github.com/JiveDig/0d3658676127f30a098859228fc5d8eb
* License: GPL2
@oneblackcrayon
oneblackcrayon / Use JQuery to show and hide elements based on data attributes.md
Last active November 22, 2023 03:40
Use JQuery to show and hide elements based on data attributes.

Use Jquery to show and hide elements with data-attributes

I needed to show and hide a list of posts on a page when clicking on links.

<main role="main">
  <nav role="navigation">
    <a href="javascript.void(0);" data-slug="slug-1">Link 1</a>
    <a href="javascript.void(0);" data-slug="slug-2">Link 2</a>
 <a href="javascript.void(0);" data-slug="slug-3">Link 3</a>
@oneblackcrayon
oneblackcrayon / mu-woo.php
Last active July 5, 2023 01:28
Must Use Plugin for Woocommerce not working
<?php
/*
Plugin Name: MU Woo Snippets
Plugin URI: https://gist.github.com/oneblackcrayon
Description:
Version: 1.0.0
Author: OneBlackCrayon
Author URI: https://gist.github.com/oneblackcrayon
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@oneblackcrayon
oneblackcrayon / rss-email.txt
Created March 26, 2023 04:06 — forked from robincornett/rss-email.txt
MailChimp RSS email template
*|RSSITEMS:|*
<h2 class="mc-toc-title"><a href="*|RSSITEM:URL|*" target="_blank">*|RSSITEM:TITLE|*</a></h2>
*|RSSITEM:CONTENT_FULL|*<br />
<a href="*|RSSITEM:URL|*" target="_blank">Read in browser &raquo;</a><br />
*|RSSITEM:TWITTER|* *|RSSITEM:LIKE|*<br />
<br />
*|END:RSSITEMS|*
@oneblackcrayon
oneblackcrayon / mail.php
Created March 26, 2023 04:06 — forked from Archie22is/mail.php
Filters images for RSS feed (Erik Teichmann)
/**
* Filters images for RSS feed--makes thumbs go through large; large images resize down to MailChimp friendly width.
* Add this to your functions.php file WITHOUT the opening php
*
* Author: Erik Teichmann, minor tweaks by Robin Cornett
* Author URI: http://www.eriktdesign.com/
*/
// Add filters for RSS
add_filter('the_excerpt_rss', 'et_change_thumbs', 20); // changes the excerpt for rss
@oneblackcrayon
oneblackcrayon / coundown.html
Last active February 27, 2023 20:06
Countdown timer with a weekly reset
<!-- @link: https://stackoverflow.com/questions/35587387/javascript-countdown-clock-every-saturday-at-11am#answer-35588057 -->
<div class="has-time">
<div id="clockdiv" class="is-time simply-countdown">
<div class="simply-section">
<span class="days simply-amount"></span>
<div class="smalltext simply-word">Days</div>
</div>
<div class="simply-section">
<span class="hours simply-amount"></span>
<div class="smalltext simply-word">Hours</div>