Skip to content

Instantly share code, notes, and snippets.

@simkoG
simkoG / simpleDirectoryLister.php
Last active June 12, 2024 07:09 — forked from nullrndtx/simpleDirectoryLister.php
A simple PHP Directory Lister
<?php
/*
*** OPTIONS ***/
// TITLE OF PAGE
$title = "List of Files";
// ADD SPECIFIC FILES YOU WANT TO IGNORE HERE
$ignore_file_list = array( ".htaccess", "Thumbs.db", ".DS_Store", "index.php" );
@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 July 26, 2024 01:10
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
*/