This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import os | |
from openai import OpenAI | |
# URL: https://gist.github.com/stracker-phil/d1d874a299883ff540966a402793f616 | |
# | |
# Usage: | |
# 1. Download the current translations as JSON format from the internal GlotPress site. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use framework "Foundation" | |
use scripting additions | |
property NSString : a reference to current application's NSString | |
property NSMutableCharacterSet : a reference to current application's NSMutableCharacterSet | |
set fileType to ".md" | |
set prefUrl to "" | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* How to use this snippet: | |
* | |
* 1. Click the "Download ZIP" button (top-right area) | |
* 2. Open wp-admin > Plugins > Add New | |
* 3. Click "Upload Plugin" and select the zip file | |
* 4. After uploading the zip file, activate the plugin | |
* | |
* ---------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Generate a random discount code that matches the given criteria. | |
* | |
* Samples: | |
* - generate_discount( 10, 'percent', '+7days', 'HI-^^^^' ); | |
* - generate_discount( 5, 'flat', '', '********' ); | |
* | |
* @param int $amount The discount code value. | |
* @param string $type The type, either [flat|percent]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
setTimeout(function () { | |
DiviArea.show('contact'); | |
}, 5000); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function () { | |
// TODO: Adjust the following two lines: | |
var popup = 'contact'; // Your Popup ID. | |
var delay = 5; // Delay [in seconds]. | |
setTimeout(function () { | |
DiviArea.show(popup); | |
}, delay * 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function ($) { | |
// TODO: Adjust the following to lines to your needs: | |
var popup = 'contact'; // Your Popup ID. | |
var distance = 500; // Scroll distance [pixel]. | |
$(window).on('scroll.popup_' + popup, function () { | |
// Check if the user scrolled far enough. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* How to use this snippet: | |
* | |
* 1. Click the "Download ZIP" button (top-right area) | |
* 2. Open wp-admin > Plugins > Add New | |
* 3. Click "Upload Plugin" and select the zip file | |
* 4. After uploading the zip file, activate the plugin | |
* | |
* ---------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Option 1: | |
* Open an existing Popup and change the URL of an iframe inside the Popup. | |
* | |
* Preparation: | |
* Create a Divi Area (or an On-Page Popup) which contains an iframe. | |
* | |
* @param {string} areaId - The ID of an existing Popup or Divi Area. | |
* @param {string} iframeUrl - The new URL of the iframe inside the Popup. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Proof of concept for https://github.com/divimode/gdpr-cache-script-styles | |
*/ | |
/** | |
* Filter all scripts and style URLs. | |
* When an external URL is detected, download the file | |
* and replace it in the page source. |
NewerOlder