Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kingkool68's full-sized avatar
💻
Coding.

Russell Heimlich kingkool68

💻
Coding.
View GitHub Profile
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active March 13, 2024 17:43
All those damned wp-config constants you can never remember.
<?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
@mbijon
mbijon / disable-xss-auditor.sh
Created September 19, 2016 19:04
CLI command to start Chrome with XSS Auditor disabled. Use for XSS/security testing
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --disable-xss-auditor --enable-devtools-experiments --disable-features=enable-automatic-password-saving
@ericandrewlewis
ericandrewlewis / gist:95239573dc97c0e86714
Last active December 12, 2023 09:52
Setting up a WordPress site on AWS

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 March 12, 2014 15:51
WordPress Config: Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
// 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];
}
@pix0r
pix0r / scrape-sitemap.sh
Last active December 24, 2022 00:21
Use wget to scrape all URLs from a sitemap.xml Usage: scrape-sitemap.sh http://domain.com/sitemap.xml
#!/bin/sh
SITEMAP=$1
if [ "$SITEMAP" = "" ]; then
echo "Usage: $0 http://domain.com/sitemap.xml"
exit 1
fi
XML=`wget -O - --quiet $SITEMAP`
@stephenharris
stephenharris / import-venues.php
Created March 21, 2017 11:12
A WP-CLI command to import a CSV of venues
<?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
@croxton
croxton / gist:4073583
Last active March 29, 2021 12:34
Install xdebug 2.2.0 for AMPPS on OSX
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
@ravibhure
ravibhure / gist:7523642
Created November 18, 2013 06:47
HAProxy config for wordpress
# 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
@georgestephanis
georgestephanis / deploy-to-svn.sh
Created November 21, 2018 14:47
Make deploying from Git repositories to SVN a bit easier.
#!/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 )
@mandelbro
mandelbro / jQuery-transitionend
Created November 13, 2012 19:40
Quick jQuery plugin to get the duration of a CSS transition for an element
(function( $ ) {
/**
* jQuery.transtionend
* Retrievs the total amount of time, in miliseconds that
* an element will be transitioned
*/
$.fn.transtionend = function() {