Skip to content

Instantly share code, notes, and snippets.

View ccurtin's full-sized avatar
🤙
makka thangs

Christopher James Curtin ccurtin

🤙
makka thangs
View GitHub Profile
@ccurtin
ccurtin / Good Job, Buddy!
Last active March 4, 2019 04:01
Updated Description via API #24
*{
font-size: "ONE MILLION and one!";
}
@ccurtin
ccurtin / woocommerce-search-products-by-category-dropdown.php
Created December 11, 2017 17:42
WooCommerce Search Products by Category Dropdown
<form name="myform" method="GET" action="<?php echo esc_url(home_url('/'));?>">
<?php if (class_exists('WooCommerce')): ?>
<?php
if (isset($_REQUEST['product_cat']) && !empty($_REQUEST['product_cat'])) {
$optsetlect = $_REQUEST['product_cat'];
} else {
$optsetlect = 0;
}
$args = array(
@ccurtin
ccurtin / Zip up a folder and all subdirs via terminal.sh
Last active February 4, 2018 21:41
Zip up a folder and all subdirs via terminal
find /FULL/PATHNAME/OF/WHAT/YOU/WANT/TO/SAVE/ -path '*/.*' -prune -o -type f -print | zip ~/WHERE_TO_SAVE.zip -@
@ccurtin
ccurtin / Doin Things
Last active January 21, 2018 08:42
Created via API
Aren't gists great!
@ccurtin
ccurtin / DERP
Last active January 21, 2018 11:19
the description for this gist!
Edit the file through GISTDOX!
yea
@ccurtin
ccurtin / add-yoast-seo-data-to-WP-REST-API.php
Created October 27, 2017 17:49
Add 'yoast' SEO data to the REST API w/ og & twitter meta fallbacks...
<?php
/*
Creates and end-point that get Yoast SEO meta tags...
*/
add_action('rest_api_init', 'add_yoast_data');
function add_yoast_data()
{
// Add your post types here...
register_rest_field(array(
@ccurtin
ccurtin / regex-patterns
Created October 27, 2017 00:33
RegEx Patterns
- Get between two quotes: https://regex101.com/r/mpgagB/1
@ccurtin
ccurtin / sort-woocommerce_package_rates.php
Created September 18, 2017 15:44
Sort the woocommerce_package_rates from lowest to highest
<?php
// credit: ChromeOrange - https://gist.github.com/ChromeOrange/10013862
add_filter( 'woocommerce_package_rates' , 'sort_woocommerce_available_shipping_methods', 10, 2 );
function sort_woocommerce_available_shipping_methods( $rates, $package ) {
// if there are no rates don't do anything
if ( ! $rates ) {
return;
}
// get an array of prices
@ccurtin
ccurtin / ImagePreloader.jsx
Created July 27, 2017 13:13
Image Preloader for React Apps - the LoadingAnimation01 can be any loading icon/CSS...
import React from 'react';
import LoadingAnimation01 from './LoadingAnimation01'
class ImgPreloader extends React.Component {
constructor(props) {
super(props);
this.state = { imageStatus: 'loading', imageLoaded: false };
}
componentDidMount() {
@ccurtin
ccurtin / Videos-XHR-multiload--for-HeroSlier-Component--FULL-EXAMPLE.jsx
Last active October 27, 2017 17:54
Asynchronously download MP4 videos plays on all modern devices and browsers. - preloads content - only the script... need the HTML Can be seen in action in to "HeroSlider.js" React Component in the Two Words website: whiteboard-pictures(private repo)
import React from 'react'
import Slider from 'react-slick'
import Helmet from 'react-helmet'
import { connect } from 'react-redux'
import { Link } from 'react-router'
import { loadVideoArray, homeSliderVideoBlobsLoaded } from './../redux'
import LineEffect from '_App/components/LineEffect'