Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Coding.

Russell Heimlich kingkool68

💻
Coding.
View GitHub Profile
@georgestephanis
georgestephanis / deploy-to-svn.sh
Created Nov 21, 2018
Make deploying from Git repositories to SVN a bit easier.
View deploy-to-svn.sh
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Run this script from within the root of the git repository that you'd like to deploy."
echo "You can only deploy something that's already been tagged in git."
echo 'Usage: `deploy-to-svn.sh <tag | HEAD>`'
exit 1
fi
GIT_DIR=$( pwd )
@stephenharris
stephenharris / import-venues.php
Created Mar 21, 2017
A WP-CLI command to import a CSV of venues
View import-venues.php
<?php
/*
Plugin Name: Import Venues WP CLI command
Plugin URI: http://wordpress.org/plugins/hello-dolly/
Description: Adds `wp eo venue import <path-to-file>` command.
Author: Stephen Harris
Version: 0.1
*/
// Exit if accessed directly
@mbijon
mbijon / disable-xss-auditor.sh
Created Sep 19, 2016
CLI command to start Chrome with XSS Auditor disabled. Use for XSS/security testing
View disable-xss-auditor.sh
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --disable-xss-auditor --enable-devtools-experiments --disable-features=enable-automatic-password-saving
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active Dec 3, 2021
All those damned wp-config constants you can never remember.
View wp-config.php
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@ericandrewlewis
ericandrewlewis / gist:95239573dc97c0e86714
Last active Nov 30, 2021
Setting up a WordPress site on AWS
View gist:95239573dc97c0e86714

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

@ryanjbonnell
ryanjbonnell / wp-config.php
Created Mar 12, 2014
WordPress Config: Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
View wp-config.php
// Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
@ravibhure
ravibhure / gist:7523642
Created Nov 18, 2013
HAProxy config for wordpress
View gist:7523642
# HAProxy config to block /wp-login.php and wp-admin POST method on wordpress webserver
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 25000
#debug
#quiet
user prod
group prod
@pix0r
pix0r / scrape-sitemap.sh
Last active Sep 11, 2021
Use wget to scrape all URLs from a sitemap.xml Usage: scrape-sitemap.sh http://domain.com/sitemap.xml
View scrape-sitemap.sh
#!/bin/sh
SITEMAP=$1
if [ "$SITEMAP" = "" ]; then
echo "Usage: $0 http://domain.com/sitemap.xml"
exit 1
fi
XML=`wget -O - --quiet $SITEMAP`
@aarongustafson
aarongustafson / undoing-tables.html
Last active Dec 11, 2015
A Strategy for Undoing Tables
View undoing-tables.html
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Dept, Title</th>
<th scope="col">Phone</th>
</tr>
</thead>
<tbody>
@croxton
croxton / gist:4073583
Last active Mar 29, 2021
Install xdebug 2.2.0 for AMPPS on OSX
View gist:4073583
Grab the 'PHP Remote Debugging Client' (the pre-complied xdebug binary for OSX) from here:
http://code.activestate.com/komodo/remotedebugging/
Unzip it, find the folder that corresponds to the version of PHP you want to install it for and copy the xdebug.so file from there into your php extensions folder in the relevant PHP version directory. E.g. for PHP 5.4:
/Applications/AMPSS/php-5.4/lib/extensions/ext/
Now open PHP.ini in a text editor:
/Applications/AMPSS/php-5.4/etc/php.ini