Skip to content

Instantly share code, notes, and snippets.

View andrewwoods's full-sized avatar

Andrew Woods andrewwoods

View GitHub Profile
@andrewwoods
andrewwoods / .gitignore
Last active February 1, 2016 03:47
WordPress Site Gitignore Boilerplate
# Common wordpress files to ignore
wp-config.php
wp-content/debug.log
wp-content/advanced-cache.php
wp-content/wp-cache-config.php
# Common wp-content directories
wp-content/backup-db/
@andrewwoods
andrewwoods / MyWidget.php
Created January 7, 2015 18:30
WordPress Widget Boilerplate
<?php
add_action( 'widgets_init', 'register_my_widget' );
class My_Widget extends WP_Widget
{
function __construct() {
$widget_options = array(
'classname' => 'my-widget-class'
@andrewwoods
andrewwoods / wp-config.php
Last active August 29, 2015 14:09
WordPress Config File wp-config.php
<?php
/**
* The base configurations of the WordPress.
*
* <ENVIRONMENT> Environment
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
@andrewwoods
andrewwoods / create.user.sql
Created November 16, 2014 17:42
A script to create a mysql user.
-- Removing the keyword PASSWORD will set the password in plain text.
CREATE USER 'wp'@'%' IDENTIFIED BY 'password';
--
-- Assign permissions to the user you just created
--
GRANT
@andrewwoods
andrewwoods / passwd-gen.php
Last active August 29, 2015 14:09
Password Generator by Pattern
#!/usr/bin/php
<?php
/**
* Generate a password based on a pattern
*
* @package Command Line
* @subpackage Utilities
* @version 1.0
* @author Andrew Woods <atwoods1@gmail.com>
*
### Keybase proof
I hereby claim:
* I am andrewwoods on github.
* I am awoods (https://keybase.io/awoods) on keybase.
* I have a public key whose fingerprint is 6FAE A355 37B1 9509 CB9A 102F C9CA 6422 EBB1 3F8A
To claim this, I am signing this object:
@andrewwoods
andrewwoods / base-wallpaper.php
Last active December 1, 2022 04:30
Create wallpapers with random patterns for your desktop.
<?php
/**
* The base class for all Wallpaper subclasses
*
* @package Wallpapers
* @access public
*/
class BaseWallpaper {
/** a handle to the image */