Skip to content

Instantly share code, notes, and snippets.

View philipdowner's full-sized avatar

Philip Downer philipdowner

View GitHub Profile
@mbejda
mbejda / Industries.csv
Last active May 14, 2024 03:29
Compiled list of industries.
Industry
Accounting
Airlines/Aviation
Alternative Dispute Resolution
Alternative Medicine
Animation
Apparel/Fashion
Architecture/Planning
Arts/Crafts
Automotive
@najamelan
najamelan / Escape.php
Last active July 4, 2019 20:25
Escape.php
<?php
/*
Correct output escaping in php is ridiculously difficult. This class does not pretend to be perfect, but is an attempt for myself to do better than scattering htmlspecialchars all over my code.
This is basically a wrapper around basic functionality like htmlspecialchars. For better security, inspired on code from Twig, who inspired themselves on Zend who inspired themselves on ESAPI. Security notice: all of the above fail to escape the comma in javascript context. This class doesn't and it also provides you with a wrapper around HTML purifier.
This comment has some bits and bops of text to make the point. References:
http://blog.astrumfutura.com/2012/06/automatic-output-escaping-in-php-and-the-real-future-of-preventing-cross-site-scripting-xss/
http://blog.astrumfutura.com/2012/03/a-hitchhikers-guide-to-cross-site-scripting-xss-in-php-part-1-how-not-to-use-htmlspecialchars-for-output-escaping/
@krusynth
krusynth / books.md
Last active June 15, 2021 16:56
A list of useful books to improve your skills

Recommended Books

A list of useful books to improve your skills

Recommendations from others are noted in (parentheses). The rest are my personal recommendations.

Programming

Building your core

  • The Pragmatic Programmer - Hunt & Thomas
@hanigamal
hanigamal / wp-install.sh
Created August 14, 2013 02:15
WordPress Commandline Local Install
#!/bin/bash
#
# WP Commandline Local Install, by Brian Richards (@rzen)
#
# Creates a new directory, downloads WordPress, creates a database, sets up wp-config,
# optionally empties wp-content, and deletes other misc files. This compliments my local
# dev setup, outlined here: http://rzen.net/development/local-develoment-in-osx/
#
# Credit:
# Based on WPBuildr (https://github.com/AaronHolbrook/wpbuildr/). Props to Aaron Holbrook
@jrfnl
jrfnl / wp-config-debug.php
Last active April 5, 2024 18:16
Code to add to wp-config.php to enhance information available for debugging.
<?php
/**
* == About this Gist ==
*
* Code to add to wp-config.php to enhance information available for debugging.
*
* You would typically add this code below the database, language and salt settings
*
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists).
*
@szbl
szbl / meta.php
Created July 4, 2013 02:59
Example view from faux MVC WordPress plugin example for CodePoet.com article.
<table class="form-table">
<tbody>
<tr>
<th>
<label for="szbl-person-email">
Email Address:
</label>
</th>
<td>
<input type="email" id="szbl-person-email" name="szbl_person_email" value="<?php
@szbl
szbl / my-plugin-snippet.php
Last active March 15, 2022 04:17
How I auto-include my library of "controllers" in a theme/plugin.
<?php
// include all PHP files in ./lib/ directory:
foreach ( glob( dirname( __FILE__ ) . '/lib/*.php' ) as $file )
include $file;
@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 ) )
<?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/
*/

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