Skip to content

Instantly share code, notes, and snippets.

View seb86's full-sized avatar
🚀

Sébastien Dumont seb86

🚀
View GitHub Profile
@jamesperrin
jamesperrin / github-labels-export.js
Last active July 17, 2023 21:03
JavaScript file for exporting GitHub labels to a JSON object.
/*
Purpose: Export the configuration settings for GitHub Labels.
(c) James Perrin, MIT License, https://www.countrydawgg.com, | @jamesperrin
Exporting Instructions:
1. Open a web browser.
2. Navigate to the desired GitHub repository.
3. Navigate to Issues tab.
@levelsio
levelsio / obfuscate.php
Last active May 5, 2023 12:33
WordPress plugin to progressively obfuscate text like MAKEbook.io
/*
--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 January 9, 2024 13:30
Disable frontend but allow REST, CRON and GraphQL Requests
<?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 3, 2024 12:07
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

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 August 24, 2022 21:52
Streamlabs Dracula Themed Chat Box
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 October 13, 2017 16:52
Calculate distance between to coordinates of latitude and longitude using the WP REST API and return posts ordered by distance from user's coordinates
<?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";
@kloon
kloon / functions.php
Last active October 27, 2021 04:47
WooCommerce 3.2: Add resend admin order email option that was removed
<?php
/**
* This adds back an option to resend the admin new order email from the order edit screen that was removed in WooCommerce 3.2
*/
/**
* Filter to add a new menu to the dropdown
*
* @param array $actions
* @return array
@levelsio
levelsio / btc-eth-dca-buy.php
Last active January 6, 2023 22:04
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//
@jessepearson
jessepearson / adding_new_webhook_topics.php
Last active September 14, 2023 10:27
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.
@ahmadawais
ahmadawais / upload-a-file.MD
Created June 18, 2017 11:07 — forked from websupporter/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle: