Skip to content

Instantly share code, notes, and snippets.

@DahmaniAdame
DahmaniAdame / creame-optimize.php
Created February 11, 2024 17:01 — forked from pacotole/creame-optimize.php
WordPress must-use plugin with site optimizations
<?php
/*
Plugin Name: Creame Optimize
Plugin URI: https://crea.me/
Description: Optimizaciones de Creame para mejorar tu <em>site</em>.
Version: 2.1.4
Author: Creame
Author URI: https://crea.me/
License: MIT License
*/

%%tana%%

  • Cheat Sheet
    • ✨ Tana Expressions
      • Title #tana-expression
        • Description:: A title expression composes values from the node into a title.
        • Attributes:: Search for Tana "Title" Attributes
      • Search #tana-expression
        • Description:: The search expression consists of a flat list of match-clauses that must be true for a node to match the search.
        • Attributes:: Search for Search Attributes + Search for Search Field Values
  • 🧩 Tana Attributes
@DahmaniAdame
DahmaniAdame / medium.user.js
Created December 13, 2023 04:25 — forked from mathix420/medium.user.js
Bypass Medium Paywall - Working late 2023 - Greasy Fork, Violentmonkey, Tampermonkey
// ==UserScript==
// @name Medium Paywall Bypass
// @namespace Violentmonkey Scripts
// @run-at document-start
// @match *://*.medium.com/*
// @match *://medium.com/*
// @match *://*/*
// @grant none
// @version 1.3
// @updateURL https://gist.githubusercontent.com/mathix420/e0604ab0e916622972372711d2829555/raw/medium.user.js
@DahmaniAdame
DahmaniAdame / googleSheetsEndpoint.js
Created July 15, 2023 07:53 — forked from thisbit/googleSheetsEndpoint.js
Google Sheets as JSON, use this with Extensions > App Script in google sheets
function getSheetDataAsJSON() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var range = sheet.getDataRange();
var values = range.getValues();
var headers = values[0];
var jsonData = [];
for (var i = 1; i < values.length; i++) {
var row = values[i];
var rowObj = {};
@DahmaniAdame
DahmaniAdame / cf_wp_worker.js
Created May 13, 2023 10:00 — forked from markomitranic/cf_wp_worker.js
CloudFlare edge worker for WP
// IMPORTANT: Either A Key/Value Namespace must be bound to this worker script
// using the variable name EDGE_CACHE. or the API parameters below should be
// configured. KV is recommended if possible since it can purge just the HTML
// instead of the full cache.
// API settings if KV isn't being used
const CLOUDFLARE_API = {
email: "", // From https://dash.cloudflare.com/profile
key: "", // Global API Key from https://dash.cloudflare.com/profile
zone: "" // "Zone ID" from the API section of the dashboard overview page https://dash.cloudflare.com/
for wpconfig in /var/www/*/wp-config.php; do \
echo; site=${wpconfig%\/wp-config.php}; site=${site#\/var\/www\/}; \
gp wp $site doctor check --all
echo
done
@DahmaniAdame
DahmaniAdame / r-debug.php
Created November 6, 2022 20:28 — forked from Rarst/r-debug.php
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/
@DahmaniAdame
DahmaniAdame / debug-hook-sequence.php
Created November 6, 2022 18:32 — forked from maheshwaghmare/debug-hook-sequence.php
Debug hook sequence in WordPress.
<?php
/**
* Debug WordPress hook sequence.
*
* > How it works?
* Add query parameter `debug` in URL e.g. https://<mysite>/?debug
* It'll show the list of Actions in sequence.
*
* @todo Change `prefix_` with your own prefix.
*

WordPress Filters Cheat Sheet

This cheat sheet explores a fundamental concept in WordPress development: filters.

In WordPress, filters enable developers to intercept and modify data as a WordPress page is loading, before sending it to the browser or saving it to the database.

Understanding how filters work isn’t all that easy, partly because the concept is difficult to visualize, and also because filters are often confused with WordPress actions. Yet, it’s an important concept to master because filters are one of the most common ways developers interact with WordPress.

For these reasons, this filter cheat sheet is ideal for those new to working with filters. This cheat sheet provides an in-depth understanding of what filters do and how they work, and provides a quick reference guide for using filters in WordPress development.

@DahmaniAdame
DahmaniAdame / list-hooked-functions.php
Created November 6, 2022 18:23 — forked from renventura/list-hooked-functions.php
List All Currently Hooked WordPress Functions
<?php //* mind this opening php tag
/**
* This snippet returns a list of all currently hooked functions.
* It is set up to output this data on a specific page. Do not output this data publicly.
* Use this snippet for debugging/testing/development.
* Source: http://www.rarst.net/wordpress/debug-wordpress-hooks/
* Modified by Ren Ventura, EngageWP.com
**/