Skip to content

Instantly share code, notes, and snippets.

👻
test status

Jesse Aldridge JesseAldridge

👻
test status
Block or report user

Report or block JesseAldridge

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@woogists
woogists / wc-create-coupon-programatically.php
Last active Jul 24, 2019
[General Snippets] Create a coupon programatically
View wc-create-coupon-programatically.php
/**
* Create a coupon programatically
*/
$coupon_code = 'UNIQUECODE'; // Code
$amount = '10'; // Amount
$discount_type = 'fixed_cart'; // Type: fixed_cart, percent, fixed_product, percent_product
$coupon = array(
'post_title' => $coupon_code,
'post_content' => '',
@harperreed
harperreed / emfitqs-local-api.md
Created Feb 17, 2018
EMFIT QS Sleep tracker location API
View emfitqs-local-api.md

EMFIT Local API

There is a functional http server running on the device that can be crawled for realtime data. It runs on port 80 and uses plain http.

You will need to know the IP address if your emfit device.

shortdvm.htm

For demoing / testing with a web browser there is an auto-refreshing page that contains only HR and RR values, it’s name is shortdvm.htm

@EdenK
EdenK / elementor-video-youtube-enablejsapi.php
Last active Sep 4, 2019
Filter to add enablejsapi to Elementor youtube video
View elementor-video-youtube-enablejsapi.php
<?php
/**
* Filter to add enablejsapi to Elementor youtube video
*/
function add_youtube_jsapi($iframe_html, $video_url, $frame_attributes) {
if(strpos($video_url, 'youtube') !== false) {
$src = esc_attr($frame_attributes['src']);
$new_src = esc_attr(add_query_arg(array('enablejsapi' => '1'), $frame_attributes['src']));
$iframe_html = str_replace($src, $new_src, $iframe_html);
}
@devinsays
devinsays / customer-new-account.php
Created Oct 3, 2017
Sends new WooCommerce customers an account email that with their email address as a login rather than a username.
View customer-new-account.php
<?php
/**
* Customer new account email
*
* This template has been overriden to change account creation text.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 1.6.4
@codediodeio
codediodeio / database.rules.json
Last active Nov 13, 2019
Common Database Rules for Firebase
View database.rules.json
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@mikaelz
mikaelz / delete-all-woocommerce-products.php
Last active Nov 4, 2019
Remove all WooCommerce products from database via SQL
View delete-all-woocommerce-products.php
<?php
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");
@pch
pch / mac-vagrant-unison.md
Last active Feb 18, 2019
How to install Unison on Mac OS El Capitan & Vagrant
View mac-vagrant-unison.md

How to install Unison on Mac OS El Capitan & Vagrant - for Docker Sync

You can install Unison on the Mac via homebrew (brew install unison), but it's very likely that it won't work properly, resulting in errors like:

Unison failed: Uncaught exception Failure("input_value: bad bigarray kind")
Fatal error: Lost connection with the server
@tothebeat
tothebeat / Makefile
Last active Nov 28, 2018
Periodic Screenshots (every 10 seconds) on Mac OS X
View Makefile
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " screencap To start recording screencaps and clean up yesterday's captures."
@echo " cleanyesterday Just delete yesterday's captures."
@echo " captoday Just start recording screencaps for today."
screencap:
./remove_yesterday_recording.sh
./start_recording.sh
@inklesspen
inklesspen / post-checkout.py
Created Jun 10, 2014
Post-checkout hook to detect alembic issues when switching branches.
View post-checkout.py
#!/usr/bin/env python
"""
Provide useful alembic information after switching branches.
"""
import argparse
import subprocess
import os
import os.path
import py.path
@XVilka
XVilka / TrueColour.md
Last active Nov 14, 2019
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
You can’t perform that action at this time.