This file contains hidden or 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
#!/bin/bash | |
#assumes new downloads of shotcut is always in ~/Downloads | |
currpath=$(pwd) | |
cd ~/Downloads | |
chmod +x ./[Ss]hotcut-*.AppImage | |
#always choose the latest Shotcut-*.AppImage download | |
shotcut=$(ls -Art [Ss]hotcut-*.AppImage | tail -n 1 | cut -d' ' -f 9-) | |
cd "${currpath}" |
This file contains hidden or 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
/* Native Error types https://mzl.la/2Veh3TR */ | |
const nativeExceptions = [ | |
EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError | |
].filter((except) => typeof except === 'function') | |
/* Throw native errors. ref: https://bit.ly/2VsoCGE */ | |
function throwNative(error) { | |
for (const Exception of nativeExceptions) { | |
if (error instanceof Exception) throw error | |
} |
This file contains hidden or 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 ob_start(); | |
header('HTTP/1.1 503 Service Temporarily Unavailable'); | |
header('Status: 503 Service Temporarily Unavailable'); | |
header('Retry-After: 3600'); | |
mail("info@ihredomain", "Datenbankfehler", "Schon wieder die Datenbank!", "From: Meine Website"); | |
?><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Website nicht erreichbar</title> |
This file contains hidden or 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 | |
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, |
This file contains hidden or 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 | |
/* | |
Plugin Name: Class To Disable WordPress Plugins By URL | |
Plugin URI: http://www.damiencarbery.com/2019/03/class-to-disable-wordpress-plugins-by-url/ | |
Description: Disable specified plugins except for certain pages - enhanced with caching. | |
Version: 0.1 | |
Author: Damien Carbery | |
Author URI: http://www.damiencarbery.com/ | |
*/ |
This file contains hidden or 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 # -*- coding: utf-8 -*- | |
declare(strict_types=1); | |
/** | |
* Plugin Name: Disable REST API | |
*/ | |
// Completely disable wp-json access. | |
add_filter( | |
'rest_authentication_errors', | |
function () { |
This file contains hidden or 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 | |
$consumer_key = ''; | |
$consumer_secret = ''; | |
// If the $_GET parameters are present, use those first. | |
if ( ! empty( $_GET['consumer_key'] ) && ! empty( $_GET['consumer_secret'] ) ) { | |
$consumer_key = $_GET['consumer_key']; // WPCS: sanitization ok. | |
$consumer_secret = $_GET['consumer_secret']; // WPCS: sanitization ok. | |
} |
This file contains hidden or 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
add_filter( 'wp_cache_preload_taxonomies', 'wpsc_preload_taxonomies' ); | |
function wpsc_preload_taxonomies( $taxes ) { | |
return array_merge( $taxes, array( 'product_tag' => 'product_tag', 'product_cat' => 'product_cat' ) ); | |
} |
This file contains hidden or 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 | |
/** | |
* Gravity Perks // Populate Anything // Populate Post Meta as Choices | |
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/ | |
*/ | |
// Update "123" with your form ID; Update "4" with your field ID. | |
add_filter( 'gppa_input_choices_123_4', function( $choices, $field, $objects ) { | |
$custom_field = str_replace( 'meta_', '', $field['gppa-choices-templates']['label'] ); | |
$meta = get_post_meta( $objects[0]->ID, $custom_field ); |
This file contains hidden or 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 | |
/** | |
* GP Unique ID // Gravity Perks // Date-specific Sequences | |
* http://gravitywiz.com/ | |
* | |
* Requirements: | |
* - Your form ID cannot be more than 3 digits. | |
* - Your field ID cannot be more than 2 digits. | |
*/ | |
// Update "123" to your form ID. Update "4" to your Unique ID field ID. |