Skip to content

Instantly share code, notes, and snippets.

View oneblackcrayon's full-sized avatar

Frederick Polk oneblackcrayon

View GitHub Profile
@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([
@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 / functions.php
Created October 17, 2022 22:07 — forked from r4nd1/functions.php
Test #1
<?php
/*
Author: Zhen Huang
URL: http://themefortress.com/
This place is much cleaner. Put your theme specific codes here,
anything else you may want to use plugins to keep things tidy.
*/
@oneblackcrayon
oneblackcrayon / gsutil_cron_example.sh
Created October 13, 2022 21:20 — forked from nazroll/gsutil_cron_example.sh
A shell script example to run "gsutil" as a cronjob
#! /bin/bash
# Replace "/path/to/gsutil/" with the path of your gsutil installation.
PATH="$PATH":/path/to/gsutil/
# Replace "/home/username/" with the path of your home directory in Linux/Mac.
# The ".boto" file contains the settings that helps you connect to Google Cloud Storage.
export BOTO_CONFIG="/home/username/.boto"
# A simple gsutil command that returns a list of files/folders in your bucket.
@oneblackcrayon
oneblackcrayon / index.php
Created June 5, 2022 03:10 — forked from lepittenger/index.php
Check if the_content is empty
<?php
if ( $post->post_content=="" ) {
// do something for posts without content
} else {
// do something for posts with content
};
// OR
@oneblackcrayon
oneblackcrayon / opencl-amd_aur_ubuntu.bash
Created April 23, 2022 20:50 — forked from nottux/opencl-amd_aur_ubuntu.bash
bash implementation of opencl-amd AUR package, Install opencl amdgpu amdgpu-pro opencl only. Supports ubuntu and others with standard prefix
#!/bin/bash
# DO NOT run the line 167 standalone. It will remove the necessary files besides the junk!
if echo $@|grep -q "\-\-help\|\-help\|\-h\|help\|\-\-h\|\-\-no\-deb\|\-\-no\-install\|\-\-no\-cleaning\|\-\-assume\-debian"
then :
else echo wrong entry\(ies\) !
help=yes
fi
if echo $@|grep -q "\-\-help\|\-help\|\-h\|help\|\-\-h" || [ "$help" = yes ]
// Utilities
@import "../../node_modules/bulma/sass/utilities/functions";
@import "../../node_modules/bulma/sass/utilities/derived-variables";
@import "../../node_modules/bulma/sass/utilities/mixins";
@import "../../node_modules/bulma/sass/utilities/controls";
// Base
@import "../../node_modules/bulma/sass/base/minireset";
@import "../../node_modules/bulma/sass/base/generic";

** WP - Optimizations and Cleanup **

Here you can find a a list of WP optimization and cleanup functions and methodology.

  1. .htaccess
  • Force https to your site.
  • Enable Browser Cache for your static files. This will fix the "Leverage Browser Caching" in the google pagespeed results.
  • Enable file compreassion for faster page load.
  1. wp-config.php
@oneblackcrayon
oneblackcrayon / functions.php
Created January 2, 2022 01:51 — forked from ellenbauer/functions.php
Aino functions.php with Custom Woo Login shortcodes
<?php
if ( ! function_exists( 'aino_setup' ) ) :
function aino_setup() {
// Adding support for featured images.
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 1800, 99999 );
// Adds custom image sizes.
add_image_size( 'aino-thumb', 1800, 1012, true ); // Image Ratio 16:9.