Skip to content

Instantly share code, notes, and snippets.

View conschneider's full-sized avatar
🐼
Relax. Nothing is under control.

Con Schneider conschneider

🐼
Relax. Nothing is under control.
View GitHub Profile
@LiamBailey
LiamBailey / Woocommerce Bookings Dropdown + handles Resources
Created March 10, 2016 18:29
Changes date-picker fields for dropdown of available dates, and refreshes dropdown if resource dropdown is changed
<?php
/*
Plugin Name: Woocommerce Bookings Dropdown
Description: Swaps the date picker for a dropdown of dates
Version: 1.0.0
Author: Webby Scots
Author URI: http://webbyscots.com/
*/
add_action('wp_ajax_wswp_refresh_dates','wswp_refresh_dates');
add_action('wp_ajax_nopriv_wswp_refresh_dates','wswp_refresh_dates');
@technosailor
technosailor / update-mysql56.sh
Created February 24, 2016 19:05
Updates VVV MySQL 5.5 to 5.6 -- Ubuntu 14.04
#!/bin/bash
# Usage: ./update-mysql56.sh
# Backup of all databases... JUST IN CASE
mysqldump --all-databases --single-transaction --events --user=root --password > ~/all_database_backup.sql
# Remove MySQL 5.5
sudo apt-get remove mysql-server
sudo apt-get autoremove
@lmarkus
lmarkus / README.MD
Last active May 21, 2024 02:50
Extracting / Exporting custom emoji from Slack

Extracting Emoji From Slack!

Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.

If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3

HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.

Follow along...

@daigo75
daigo75 / woocommerce-restrict-cart-product-combinations.php
Last active July 10, 2023 21:12
WooCommerce – Only allow certain product combinations in cart
// Step 1 - Keep track of cart contents
add_action('wp_loaded', function() {
// This variable must be global, we will need it later. If this code were
// packaged as a plugin, a property could be used instead
global $allowed_cart_items;
// We decided that products with ID 737 and 832 can go together. If any of them
// is in the cart, all other products cannot be added to it
$restricted_cart_items = array(
737,
832,
@mathetos
mathetos / plugin.php
Last active April 13, 2023 16:48
Dependent Plugin Activation/Deactivation and Alert
<?php
/*
* Dependent Plugin Activation/Deactivation
*
* Sources:
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/
*
*/
@kovshenin
kovshenin / subscribers-count.php
Created November 19, 2015 13:03
Get subscribers count via the MailChimp API.
<?php
/**
* Get subscribers count via the MailChimp API.
*/
function mailchimp_get_subscribers_count() {
$cache_key = 'mailchimp-subscribers';
$api_key = '';
$username = '';
$dc = '';
$list_id = '';
@johnbillion
johnbillion / wp_mail.md
Last active May 12, 2024 14:19
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@bavington
bavington / wp_custom_toolbar_link.php
Last active March 11, 2019 13:31
Adding a custom link to the WordPress Admin/Toolbar complete with icon.
function sv_add_weight_to_csv_export_import_format( $order_data, $order ) {
$count = 1;
// add line items
foreach ( $order->get_items() as $item ) {
$product = $order->get_product_from_item( $item );
if ( ! is_object( $product ) ) {
@thomasgriffin
thomasgriffin / api-helper.php
Last active March 13, 2019 13:46
API Helper to be used during API requests. Should be used as a must-use plugin in WordPress.
<?php
/**
* Plugin Name: TGM API Helper
* Plugin URI: https://thomasgriffin.io
* Description: Whitelists the plugins to be loaded during API requests to reduce overhead.
* Author: Thomas Griffin
* Author URI: https://thomasgriffin.io
* Version: 1.0.0
*/