Skip to content

Instantly share code, notes, and snippets.

View philipdowner's full-sized avatar

Philip Downer philipdowner

View GitHub Profile
@chuckreynolds
chuckreynolds / Wordpress .HTACCESS file
Created June 25, 2009 06:39
Hardened .htaccess file for WP installs
# canonical redirect to no www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# protect wp-config at all cost
<files wp-config.php>
Order deny,allow
deny from all
</files>
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@awshout
awshout / foundation3-navbar-menu.php
Last active October 13, 2021 17:07
WordPress Menu & Walker for ZURB's Foundation 3 Nav Bar
<?php
add_theme_support('menus');
/*
http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus( array(
'main-menu' => 'Main Menu' // registers the menu in the WordPress admin menu editor
) );
@malarkey
malarkey / Contract Killer 3.md
Last active May 24, 2024 23:38
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@planktonWD
planktonWD / wp_install_default.sh
Created November 12, 2012 04:08 — forked from hansipete/wp_install_default.sh
Default Install Script for WordPress Setup on MAMP localhost
#!/bin/bash
##############################
# DEFAULT WORDPRESS AND PLUGIN INSTALL SCRIPT
#
# 2012-04-03
# 1.0
# TODO: PUT A YES/NO PROMPT BEFORE RUNNING SCRIPT
# !!!!! EXITS UNLESS YOU MANUALLY COMMENT OUT THE LINE BELOW
# exit
@malarkey
malarkey / Three Wise Monkeys.md
Created December 2, 2012 14:26
Three Wise Monkeys (NDA)

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

Contract

[Client ID] [Project/Service ID] [Contract ID] [Date]

Between me, Andrew Watson and you, [Client Name], referred to throughout this document as me or I and you or your respectively.

Summary

<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@szbl
szbl / wp-singleton-namespace-example.php
Last active December 21, 2018 05:56
Quick Singleton class to be included in WordPress plugin (or theme functions.php file) that will create a simple Person post type and shows some methods of encapsulating functionality in a class as a "namespace," as well as applying filters to things, allowing other users to extend your code.
<?php
class Sizeable_Person
{
const POST_TYPE_SLUG = 'szbl-person';
public static $instance;
public static function init()
{
if ( is_null( self::$instance ) )