Skip to content

Instantly share code, notes, and snippets.

@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:04
WordPress: Remove unwonted image sizes, like medium_large, 1536x1536, 2048x2048
<?php
/*
* WordPress: Remove unwonted image sizes.
* In this code I remove the three sizes medium_large, 1536x1536, 2048x2048
* See full article:
*/
add_filter('intermediate_image_sizes', function($sizes) {
return array_diff($sizes, ['medium_large']); // Medium Large (768 x 0)
@olikdesign
olikdesign / telekom-datenvolumen
Last active June 27, 2023 12:53
Telekom Datenvolumen Widget - edit olikdesign (orig. @Sillium)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: pink; icon-glyph: magic;
// creator: https://github.com/Sillium | functions added https://github.com/LupusArgentum | Color and Layout edit by https://github.com/olikdesign
const apiUrl = "https://pass.telekom.de/api/service/generic/v1/status"
let widget = await createWidget()
widget.backgroundColor = new Color("#E20074")
if (!config.runsInWidget) await widget.presentSmall()
const apiUrl = "https://pass.telekom.de/api/service/generic/v1/status"
let widget = await createWidget()
widget.backgroundColor = new Color("#777777")
if (!config.runsInWidget) {
await widget.presentSmall()
}
Script.setWidget(widget)
Script.complete()
@wpmudev-sls
wpmudev-sls / forminator-limit-the-date-of-birth.php
Last active September 11, 2021 12:11
[Forminator] - Limit the birthday date
<?php
/**
* Plugin Name: [Forminator] - Limit the date of birth
* Description: [Forminator] - Limit the date of birth
* Task: 0/11289012348292/1172860968808076
* Author: Thobk @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) { exit; } elseif ( defined( 'WP_CLI' ) && WP_CLI ) { return; }
@blanboom
blanboom / tmcleanup.md
Last active December 3, 2023 07:19 — forked from linjer/tmcleanup.md
Script to automatically remote old Mac OSX Time Machine Backups older than a specified number of days

Prerequisites

  • gfind (via brew install findutils)
  • Time Machine drive mounted on your computer (or you can change path from standard /Volume/Time\ Machine\ Backups/Backups.backup.db/
  • Admin/sudo access in the OSX terminal

Script

  • Be sure to set the correct machine name. You can check the actual folder things are going into by looking in the backup location.
  • By default, it erases all backups older than 30 days. Adjust as desired.
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
@kslstn
kslstn / themes.js
Last active July 2, 2023 17:04
My script to add theming support and switch between light mode and dark mode
// Find if user has set a preference and react to changes
(function initializeTheme(){
syncBetweenTabs()
listenToOSChanges()
enableTheme(
returnThemeBasedOnLocalStorage() ||
returnThemeBasedOnOS() ||
returnThemeBasedOnTime(),
false)
}())
@wpmudev-sls
wpmudev-sls / wpmudev-forminator-listing-author.php
Last active November 21, 2022 15:41
[Forminator Pro] - Send email to listing's author. Extend existing functionality of Easy Property Listing to send email to listing's author
<?php
/**
* Plugin Name: [Forminator Pro] - Send email to listing's author
* Plugin URI: https://premium.wpmudev.org/
* Description: Extend existing functionality of Easy Property Listing to send email to listing's author (as of 1.9)
* Author: Alessandro Kaounas @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
@serkanalgur
serkanalgur / .htaccess
Last active September 13, 2023 08:50 — forked from seoagentur-hamburg/.htaccess
UPDATE 2021: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2019
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://andreas-hecht.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################