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
#!/bin/bash | |
#your variables here, you can set AWS credentials here as well | |
AWS_REGION=$YourAWSRegion | |
DEP_GROUP=$NameOfYourCodeDeployDeploymentGroup | |
APP_NAME=$NameOfYourCDApplication | |
# list successfull deployments only | |
STATUS=Succeeded |
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 | |
/* | |
Plugin Name: Coderrr S3 Conversion | |
Description: Converts previously uploaded attachments to work with amazon-s3-and-cloudfront plugin | |
Version: 0.1 | |
Author: Brian Fegter | |
License: GPLv2+ | |
*/ | |
/** |
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 | |
function send_http_auth_headers(){ | |
header('WWW-Authenticate: Basic realm="Your Website Name Restricted"'); | |
header('HTTP/1.0 401 Unauthorized'); | |
echo 'Please speak to an administrator for access to the this feature.'; | |
exit; | |
} | |
add_action('template_redirect', 'maybe_add_http_auth_basic', 0); | |
function maybe_add_http_auth_basic(){ | |
# Add your specific URI segment (i.e. http://example.com/segment-string/) |
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 a query var to sniff requests | |
add_filter( 'query_vars', 'my_query_var_callback', 10, 1 ); | |
function my_query_var_callback( $vars ){ | |
$vars[] = 'dynamic_js'; | |
return $vars; | |
} | |
#Dynamic JavaScript | |
add_rewrite_rule( '^assets/js/dynamic\.js$', 'index.php?dynamic_js=1', 'top' ); //Note the hidden query variable |
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
_______ ______ __ _ ___ ___ | |
|_ __ \ .' ____ \ [ | / |_ .' ..] .' ..] | |
| |__) | .---. .--./) .---. _ __ | (___ \_| .---. | |--. `| |-'__ _ _| |_ _| |_ | |
| __ / / /__\\/ /'`\;/ /__\\[ \ [ ] _.____`. / /'`\] | .-. | | | [ | | |'-| |-''-| |-' | |
_| | \ \_| \__.,\ \._//| \__., > ' < | \____) || \__. | | | | | |, | \_/ |, | | | | | |
|____| |___|'.__.'.',__` '.__.'[__]`\_] \______.''.___.'[___]|__]\__/ '.__.'_/[___] [___] | |
( ( __)) | |
--------------------------------------------------------------------------------------------------------------- |
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 | |
# ------------------ | |
# no shenanigans | |
# ------------------ | |
if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) { die(); } | |
# --------------- | |
# server name | |
# --------------- | |
$server = $_SERVER['SERVER_NAME']; |
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 | |
#Set your current WP install URL | |
$url = 'http://currentwpinstall.com'; | |
#Create cookie string | |
$cookie_string = ''; | |
foreach($_COOKIE as $k => $v) | |
#Assure we are setting the proper string if other cookies are set | |
if(preg_match('/(wordpress_test_cookie|wordpress_logged_in_|wp-settings-1|wp-settings-time-1)/', $k)) | |
$cookie_string .= $k . '=' . urlencode($v) . '; '; |
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 | |
/* | |
Plugin Name: Audit Attachments | |
Description: Reports on a set of post types and their respective attachments | |
Version: 0.1 | |
Author: Brian Fegter | |
Author URI: http://coderrr.com/ | |
*/ | |
/** |
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 | |
/** | |
* Usage when logged in: http://yourdomain.com/wp-admin/remove-404-attachments=secretpassword | |
*/ | |
# Hook late into admin_init | |
add_action('admin_init', 'remove_404_attachments', 9999999); | |
function remove_404_attachments(){ |
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 | |
/* | |
Plugin Name: Pug Bomb API Endpoint | |
Description: Adds an API endpoint at /api/pugs/$n_pugs | |
Version: 0.1 | |
Author: Brian Fegter | |
Author URL: http://coderrr.com | |
*/ | |
class Pugs_API_Endpoint{ |
NewerOlder