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 | |
add_action('admin_init', function () { | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ($pagenow === 'edit-comments.php') { | |
wp_redirect(admin_url()); | |
exit; | |
} |
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
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME}\.php -f | |
RewriteRule ^(.*)$ $1.php | |
ErrorDocument 400 /error_pages/400.php | |
ErrorDocument 401 /error_pages/401.php | |
ErrorDocument 403 /error_pages/403.php | |
ErrorDocument 404 /error_pages/404.php | |
ErrorDocument 410 /error_pages/410.php |
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 | |
// Disable support for comments and trackbacks in post types | |
function df_disable_comments_post_types_support() { | |
$post_types = get_post_types(); | |
foreach ($post_types as $post_type) { | |
if(post_type_supports($post_type, 'comments')) { | |
remove_post_type_support($post_type, 'comments'); | |
remove_post_type_support($post_type, 'trackbacks'); | |
} |
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
ServerName [% vhost.servername %] | |
[% IF vhost.serveralias_array.size -%] | |
[% FOREACH alias IN vhost.serveralias_array -%] | |
ServerAlias [% alias %] | |
[% IF alias == 'www.' _ vhost.servername -%] | |
RewriteCond %{HTTPS} !=on | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
[% END -%] |
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/perl -w | |
eval 'exec perl -S $0 "$@"' | |
if 0; | |
=head1 NAME | |
pflogsumm.pl - Produce Postfix MTA logfile summary | |
Copyright (C) 1998-2010 by James S. Seymour, Release 1.1.3. |
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
function send_pushover_notification() { | |
var push = require( 'pushover-notifications' ); | |
var p = new push( { | |
user: "xxxx", | |
token: "xxxx" | |
}); | |
var msg = { |
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 | |
/** | |
* Script in order to compare a set of DNS Records from the current DNS supplier, to a new Name Server | |
* A standard array of records are setup, and can be enabled/disabled as required, and altered | |
* Then set a domain, and new Name Server to check against, and run the script in CLI PHP | |
* ./dns_checker.php | |
* | |
* This will create a HTML file in your current folder with details of the checks. | |
* | |
* N.B. You must have Net_DNS2 PEAR module installed 'pear install Net_DNS2' |
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
/* | |
* System Versioning Preprocessor Macros | |
*/ | |
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) | |
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) | |
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) |
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 | |
require 'app/Mage.php'; | |
Mage::app(); | |
$amount = 0; | |
$model = Mage::getModel('catalog/product'); | |
$products = $model->getCollection(); | |
foreach ($products as $product) { | |
$model->load($product->getId()); | |
$product->setUrlKey($model->getName())->save(); | |
set_time_limit(); |
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
$_SESSION['UniqueRefMaxLength'] |
NewerOlder