Skip to content

Instantly share code, notes, and snippets.

View robertdevore's full-sized avatar
🐺
#LoneWolfLifestyle

Robert DeVore robertdevore

🐺
#LoneWolfLifestyle
View GitHub Profile
/**
* Block dependencies
*/
import icon from './icon';
import SelectTeam from '../select-team';
//import './style.scss';
import './editor.scss';
/**
* Internal block libraries
@ahmadawais
ahmadawais / AA-Git-Commit-Log.md
Last active May 5, 2018 16:29
AA Git Commit Log
@lukecav
lukecav / functions.php
Created December 29, 2017 16:38
Get All orders IDs for a given product ID in WooCommerce
/**
* Get All orders IDs for a given product ID.
*
* @param integer $product_id (required)
* @param array $order_status (optional) Default is 'wc-completed'
*
* @return array
*/
function get_orders_ids_by_product_id( $product_id, $order_status = array( 'wc-completed' ) ){
global $wpdb;
import requests
import sys
import json
def waybackurls(host, with_subs):
if with_subs:
url = 'http://web.archive.org/cdx/search/cdx?url=*.%s/*&output=json&fl=original&collapse=urlkey' % host
else:
url = 'http://web.archive.org/cdx/search/cdx?url=%s/*&output=json&fl=original&collapse=urlkey' % host
@lukecav
lukecav / functions.php
Last active September 4, 2018 03:59
Redirect to shop if cart is empty in WooCommerce
function cart_empty_redirect_to_shop() {
global $woocommerce;
if ( is_page('cart') and !sizeof($woocommerce->cart->cart_contents) ) {
wp_redirect( get_permalink( wc_get_page_id( 'shop' ) ) ); exit;
}
}
add_action( 'wp_head', 'cart_empty_redirect_to_shop' );
@OriginalEXE
OriginalEXE / pe-customize-controls.css
Last active June 26, 2023 05:07
Extending WordPress Customizer Panels and Sections to allow nesting
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent,
#customize-theme-controls .customize-pane-child.current-section-parent {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
}
@zuhairkareem
zuhairkareem / upgrade_php_5-5_7-1_ubuntu.md
Last active March 24, 2021 05:24
Upgrading php 5.5.9 to php 7.1 in Ubuntu 14.04 LTS

Add the PPA

sudo add-apt-repository ppa:ondrej/php

Update repos

sudo apt-get update
@keeferrourke
keeferrourke / install-google-fonts.sh
Last active May 22, 2023 12:38
A bash script to install all Google Fonts, system wide, on debian based systems (ex. Ubuntu)
#!/bin/sh
# Written by: Keefer Rourke <https://krourke.org>
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git>
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git
sudo apt-get install fonts-cantarell ttf-ubuntu-font-family git
srcdir="/tmp/google-fonts"
pkgdir="/usr/share/fonts/truetype/google-fonts"
giturl="git://github.com/google/fonts.git"
@ramiabraham
ramiabraham / gethooks
Last active April 21, 2023 13:38
Copy all actions and filters in a plugin and save to a file.
#!/bin/bash
#
# Prints all hooks in a dir to a .log file.
#
# Permissions issues:
# run: chmod +x gethooks
#
# gist: https://gist.github.com/ramiabraham/e8356e00130351ddcbe2c62125e6c52a
#
# Easy usage:
<?php
function ibenic_get_all_zones() {
if( class_exists( 'WC_Shipping_Zones' ) ) {
$all_zones = WC_Shipping_Zones::get_zones();
return $all_zones;
}
return false;
}