Skip to content

Instantly share code, notes, and snippets.

@thecancerus
thecancerus / inc-db-backup.sh
Last active April 25, 2019 06:51
taking incremental backups
#!/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")
@thecancerus
thecancerus / backup.sh
Last active September 24, 2019 04:49
Backup Script for WordPress to s3 using s3cmd
#!/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/"
/**
* 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:
<?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') {
<?php
class PHPFatalError {
public function setHandler()
{
register_shutdown_function('handleShutdown');
}
}
function handleShutdown()
<?php
class ExceptionHook
{
public function SetExceptionHandler()
{
set_exception_handler(array($this, 'HandleExceptions'));
}
public function HandleExceptions($exception)