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 | |
class ExceptionHook | |
{ | |
public function SetExceptionHandler() | |
{ | |
set_exception_handler(array($this, 'HandleExceptions')); | |
} | |
public function HandleExceptions($exception) |
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 | |
class PHPFatalError { | |
public function setHandler() | |
{ | |
register_shutdown_function('handleShutdown'); | |
} | |
} | |
function handleShutdown() |
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: Instrument Hooks for WordPress | |
Description: Instruments Hooks for a Page. Outputs during the Shutdown Hook. | |
Version: 0.1 | |
Author: Mike Schinkel | |
Author URI: http://mikeschinkel.com | |
*/ | |
if (isset($_GET['instrument']) && $_GET['instrument']=='hooks') { |
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
/** | |
* Bootstrap Walker for Wordpress Navigation Menu | |
* | |
* Extends WordPress walker class to add support for Twitter Bootstrap navigation menu and JS dropdowns. | |
* Caveats and features: | |
* - Only top level elements with children will be turned into dropdowns | |
* - Can be used in a Bootstrap nav but needs some CSS styling to improve presentation | |
* - With extra CSS multiple columns can be shown in a dropdown (sort of a simple mega-menu) | |
* | |
* Multi column dropdowns (mega-menu) via CSS: |
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
#!/usr/bin/env bash | |
# Back up Script to Amazon S3 | |
# Source: | |
# Author: Amit | |
#path to WordPress installations | |
SITESTORE=/var/www | |
#S3 bucket | |
S3DIR="s3://bucket-name/" |
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
#!/usr/bin/env bash | |
# Back up Script to take Incremental Backups | |
# Source: | |
# Author: Amit | |
DAY=$(date +"%Y%m%d") | |
T=$(date +"%H%M") | |
MONTH=$(date +"%Y%m") | |
YEAR=$(date +"%Y") |
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
#!/usr/bin/env bash | |
# Back up Script to Daily Full Backups | |
# Source: | |
# Author: Amit | |
DAY=$(date +"%Y%m%d") | |
MONTH=$(date +"%Y%m") | |
YEAR=$(date +"%Y") | |
YDAY=$(date -d '-1 day' '+%Y%m%d') |
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
#!/usr/bin/env bash | |
# Back up Script to Amazon S3 | |
# Source: | |
# Author: Amit | |
DATE=$(date +%Y%m%d%H%M) | |
LOGFILE=/var/log/prod-restore/$DATE.log | |
EMAIL='' |
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
#!/usr/bin/env bash | |
# Back up Script to Daily Full Backups | |
# Source: | |
# Author: Amit | |
DAY=$(date +"%Y%m%d-%H%M") | |
DAY2=$(date +"%Y%m%d") | |
DAY3=$(date +"%Y%m") | |
mkdir -p /var/log/psx/$DAY3/$DAY2 |
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
#!/usr/bin/env bash | |
# Back up Script to Amazon S3 | |
# Source: | |
# Author: Amit | |
#path to WordPress installations | |
SITESTORE=/var/www | |
#S3 bucket | |
S3DIR="s3://<BUCKETNAME>/" |
OlderNewer