Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sébastien Dumont seb86

🏠
Working from home
View GitHub Profile
@kennethcassel
kennethcassel / sleep_money.py
Last active Apr 7, 2021
Find out how much money you've earned on Stripe while you've slept
View sleep_money.py
import stripe
import time
from time import mktime
from datetime import datetime, time
import pytz
# Replace with your stripe secret key. DO NOT SHARE YOUR STRIPE KEY
stripe.api_key = ""
View Better Stripe Invoice Generator by @levelsio
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
@jessepearson
jessepearson / functions.php
Last active Jan 27, 2021
Disables opening Terms and Conditions on WooCommerce Checkout page in an inline form and instead open in a new tab or window.
View functions.php
<?php // do not copy this line
/**
* Disables opening the Terms and Conditions page in an inline form on the Checkout page.
* The Terms and Conditions link will then open in a new tab/window.
*/
add_action( 'wp', function() {
remove_action( 'woocommerce_checkout_terms_and_conditions', 'wc_checkout_privacy_policy_text', 20 );
remove_action( 'woocommerce_checkout_terms_and_conditions', 'wc_terms_and_conditions_page_content', 30 );
} );
View add-colors-and-gradients-to-gutenberg.php
/**
* Block Editor Settings.
* Add custom colors and gradients to the editor.
*/
function tabor_add_colors_and_gradients() {
$colors = array(
'primary' => '#db1c7d',
'secondary' => '#a528f0',
'tertiary' => '#90cbff',
@seb86
seb86 / wcs-contract-subscription.php
Last active Apr 25, 2020
Disables certain action buttons for weekly subscriptions and subscriptions with a free trial. Weekly subscriptions can not be cancelled for at least a year.
View wcs-contract-subscription.php
<?php
/*
* Plugin Name: WooCommerce Subscriptions - Contract Subscriptions
* Description: Disables certain action buttons for weekly subscriptions and subscriptions with a free trial. Weekly subscriptions can not be cancelled for at least a year.
* Author: Sébastien Dumont
* Author URI: https://sebastiendumont.com
* Version: 0.0.2
*
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
@levelsio
levelsio / obfuscate.php
Last active Dec 10, 2020
WordPress plugin to progressively obfuscate text like MAKEbook.io
View obfuscate.php
/*
--PIETZ OBFUSCATE CODE--
2019-06-01
from MAKEbook.io
Instructions:
1) put this in your functions.php file
2) add this to the post you want to obfuscate, on top
3) [obfuscate]
4) to start obfuscating, add a HTML code or HTML block with <start></start>
@jasonbahl
jasonbahl / disable-frontent.php
Last active Apr 16, 2021
Disable frontend but allow REST, CRON and GraphQL Requests
View disable-frontent.php
<?php
add_action( 'parse_request', 'disable_front_end', 99 );
function disable_front_end() {
global $wp;
/**
* If the request is not part of a CRON, REST Request, GraphQL Request or Admin request,
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active May 17, 2021
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro
View flywheel-local-xdebug-vscode.md

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@noopkat
noopkat / chat.js
Last active Apr 11, 2020
Streamlabs Dracula Themed Chat Box
View chat.js
const setup = () => {
const nearestColorScript = document.createElement('script');
document.body.appendChild(nearestColorScript);
nearestColorScript.onload = onScriptLoad;
nearestColorScript.src = 'https://cdn.rawgit.com/dtao/nearest-color/a017c25b/nearestColor.js';
}
const onScriptLoad = () => {
console.log('nearest color script loaded');
@ChrisFlannagan
ChrisFlannagan / geodistance.php
Created Oct 13, 2017
Calculate distance between to coordinates of latitude and longitude using the WP REST API and return posts ordered by distance from user's coordinates
View geodistance.php
<?php
/**
* Heavily borrowed from: http://xplus3.net/2010/08/08/filtering-on-a-non-standard-database-field-with-wordpress/
**/
class CoordinatesTable extends DB {
protected $db_option = "coordinates_db";