Skip to content

Instantly share code, notes, and snippets.

View JesseAldridge's full-sized avatar
👻
test status

Jesse Aldridge JesseAldridge

👻
test status
View GitHub Profile
@mikaelz
mikaelz / delete-all-woocommerce-products.php
Last active April 30, 2024 06:07
Remove all WooCommerce products from database via SQL
<?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 April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@tegansnyder
tegansnyder / Preventing-Puppeteer-Detection.md
Created February 23, 2018 02:41
Preventing Puppeteer Detection

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
# See official docs at https://dash.plotly.com
# pip install dash pandas
from dash import Dash, dcc, html, Input, Output
import plotly.express as px
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv')
@Terrance
Terrance / Shlex.js
Last active March 15, 2024 06:28
A function for parsing shell-like quoted arguments into an array, similar to Python's shlex.split. Also allows quotes mid-way through a string, and parses them out for you. Returns false on failure (from unbalanced quotes).
function shlex(str) {
var args = str.split(" ");
var out = [];
var lookForClose = -1;
var quoteOpen = false;
for (var x in args) {
if (args.hasOwnProperty(x)) {
var arg = args[x];
var escSeq = false;
for (var y in arg) {
@EdenK
EdenK / elementor-video-youtube-enablejsapi.php
Last active March 14, 2024 13:37
Filter to add enablejsapi to Elementor youtube video
<?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);
}
@codediodeio
codediodeio / database.rules.json
Last active January 28, 2024 19:07
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@Treer
Treer / gist:c7d7e33289b725dfb9d07718f6153a9d
Created December 11, 2016 13:18
Find most active fork of a github project
http://forked.yannick.io/
@richardhsu
richardhsu / so_xml2sql.py
Created December 13, 2012 07:05
XML to SQL converter for Stack Overflow XML data dump files. For newer versions of MySQL you can use the LOAD XML and it can work out but for older versions this script can help.
#!/usr/bin/env python
""" Stack Overflow XML 2 SQL
The following is a custom made XML 2 SQL converter for Stack Overflow data.
Latest Stack Overflow Data: August 2012
Call Examples:
@devinsays
devinsays / customer-new-account.php
Created October 3, 2017 20:36
Sends new WooCommerce customers an account email that with their email address as a login rather than a username.
<?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