Skip to content

Instantly share code, notes, and snippets.

View aidenvalentine's full-sized avatar
🏠
Working from home

Aiden Valentine aidenvalentine

🏠
Working from home
View GitHub Profile
@marcbelmont
marcbelmont / spotify-ad-muter.user.js
Last active April 22, 2024 10:28
Spotify Ad Muter. Automatically mute (block) Spotify ads. Turn sound on again after the ad.
// ==UserScript==
// @name Spotify Ad Muter
// @version 1.2
// @namespace http://tampermonkey.net/
// @description Detects and blocks ads on Spotify. Automatically mute Spotify ads. Turn sound on again after the ad.
// @match https://*.spotify.com/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.github.com/marcbelmont/1ea63270867a4e8786dd5f172d8d4489/raw
// @updateURL https://gist.github.com/marcbelmont/1ea63270867a4e8786dd5f172d8d4489/raw
@smchenrybc
smchenrybc / yoast-db-cleanup.sql
Last active January 21, 2019 06:10
SQL Script for deleting orphaned Yoast meta data. (Update table prefix!)
/**
* yoast-db-cleanup.sql
*/
/*
Options
*/
DELETE FROM prefix_options WHERE option_name = 'wpseo';
DELETE FROM prefix_options WHERE option_name LIKE 'wpseo_%';
DELETE FROM prefix_options WHERE option_name LIKE '_transient_timeout_wpseo_%';
@JiveDig
JiveDig / functions.php
Last active December 1, 2022 21:24
Get the primary term of a post, by taxonomy. If Yoast Primary Term is used, return it, otherwise fallback to the first term.
<?php
/**
* Gets the primary term of a post, by taxonomy.
* If Yoast Primary Term is used, return it,
* otherwise fallback to the first term.
*
* @version 1.3.0
*
* @link https://gist.github.com/JiveDig/5d1518f370b1605ae9c753f564b20b7f
@rwsite
rwsite / yoastSeo.js
Created August 31, 2018 01:01
Adding Content from custom fields to Yoast SEO Analysis Using YoastJS
console.log('script ready');
(function($) {
var MyYoastPlugin = function()
{
YoastSEO.app.registerPlugin('myYoastPlugin', {status: 'loading'});
this.getData();
@madebyollin
madebyollin / make_audiobook.py
Last active September 17, 2024 12:59
Converts an epub or text file to audiobook via Google Cloud TTS
#!/usr/bin/env python3
"""
To use:
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client
2. install pandoc and pypandoc, also tqdm
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub
"""
import re
import sys
@ccurtin
ccurtin / add-yoast-seo-data-to-WP-REST-API.php
Created October 27, 2017 17:49
Add 'yoast' SEO data to the REST API w/ og & twitter meta fallbacks...
<?php
/*
Creates and end-point that get Yoast SEO meta tags...
*/
add_action('rest_api_init', 'add_yoast_data');
function add_yoast_data()
{
// Add your post types here...
register_rest_field(array(
@jbanquo
jbanquo / xvideos_dl.py
Created October 22, 2017 13:02
xvideos downloader, place the urls in a file called 'url.txt' and run it!
import re
import requests
import urllib3
def download_src(url, chunk_size=1024):
req = urllib3.PoolManager().request('GET', url, preload_content=False)
src = req.data.decode('utf-8')
req.release_conn()
@ofernandolopes
ofernandolopes / functions.php
Last active November 23, 2017 00:07
Hide WooCommerce product images
//Hide WooCommerce product images
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
@jawinn
jawinn / primary_category.php
Last active December 8, 2022 21:42
Display Primary Category (Yoast's WordPress SEO)
<?php
/**
* Get the Yoast primary category from its post meta value, and displays it, with HTML markup.
* If there is no primary category set, it displays the first assigned category.
*
* @param boolean $useCatLink Whether to link the category, if it exists
* @return void
*/
function yourtheme_display_yoast_primary_category( $useCatLink = true ) {
@odan
odan / xampp_php7_xdebug.md
Last active October 19, 2024 04:15
Installing Xdebug for XAMPP