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
@mikaelz
mikaelz / delete-all-woocommerce-products.php
Last active Jul 22, 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')");
@XVilka
XVilka / TrueColour.md
Last active Jul 22, 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)
@codediodeio
codediodeio / database.rules.json
Last active Jul 17, 2019
Common Database Rules for Firebase
View database.rules.json
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@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

@woogists
woogists / wc-create-coupon-programatically.php
Last active Jun 27, 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' => '',
View gist:216120
:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom
@benatkin
benatkin / Global.sublime-settings
Created Jul 20, 2011
excluding node_modules from Sublime Text 2
View Global.sublime-settings
// Place user-specific overrides in this file, to ensure they're preserved
// when upgrading
{
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}
@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
You can’t perform that action at this time.