You can use the .phar
for PHPCS, but it's easier to pull the repo down from git to then choose what version to use.
cd ~
mkdir -p code
cd code
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs
var countryCodes = { | |
'Afghanistan': '93', | |
'Albania': '355', | |
'Algeria': '213', | |
'American Samoa': '684', | |
'Andorra': '376', | |
'Angola': '244', | |
'Antigua and Barbuda': '1-268', | |
'Argentina': '54', | |
'Armenia': '374', |
http://www.youtube.com/watch?v=-FRm3VPhseI Google's Clean Code Talks | |
http://blog.gordon-oheim.biz/2011-01-17-Why-Singletons-have-no-use-in-PHP/ | |
http://sebastian-bergmann.de/archives/882-Testing-Code-That-Uses-Singletons.html | |
http://eamann.com/tech/making-singletons-safe-in-php/ | |
http://hakre.wordpress.com/2012/06/10/the-missing-patterns-of-the-php-manual/#p2 | |
http://blogs.msdn.com/b/scottdensmore/archive/2004/05/25/140827.aspx | |
http://www.phptherightway.com/pages/Design-Patterns.html ("You should be wary when using the singleton pattern, as by its very nature it introduces global state into your application, reducing testability.") | |
http://www.practicaldesignpatternsinphp.com/ ("The Singleton Pattern is perhaps the most well known - and most often misused - pattern in all of PHP design pattern development. Its simplicity, combined with its seeming benefits makes it a widely-used (and overused) pattern. The Singleton is not so much a recommended pattern, as a pattern I recommend you shy away from.") | |
http://www.sli |
<IfModule mod_headers.c> | |
# HSTS - force redirect to HTTPS at the browser level. | |
# Submit for Chrome preload list at https://hstspreload.appspot.com/ | |
# Header always set Strict-Transport-Security: "max-age=31536000; includeSubDomains; preload" env=HTTPS | |
# X-Xss-Protection | |
Header always set X-XSS-Protection "1; mode=block" | |
# Stop clickjacking by only allowing us to frame our own site | |
Header always set X-Frame-Options "SAMEORIGIN" |
<?xml version="1.0"?> | |
<ruleset name="phpmd.xml" | |
xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | |
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
<description>PHPMD Ruleset for a WordPress Theme</description> | |
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" /> | |
<rule ref="rulesets/cleancode.xml/ElseExpression" /> | |
<rule ref="rulesets/cleancode.xml/StaticAccess" /> |
<?php | |
/** | |
* Greatest Common Factor. | |
* | |
* @package GreatestCommonFactor | |
* @author Gary Jones | |
* @link http://code.garyjones.co.uk/greatest-common-factor-class/ | |
* @license http://gamajo.mit-license.org/2011 | |
*/ |
<?php | |
add_filter( 'template_include', 'ja_template_include' ); | |
/** | |
* Apply a template to all subcategories of a certain parent category. | |
* | |
* @author Jared Atchison | |
* @link http://www.jaredatchison.com/2011/10/02/taking-advantage-of-the-template_include-filter/ | |
* | |
* @param string $template Existing path to template file | |
* @return string Potentially amended path to template file |
<?php | |
/** | |
* WordPress Prep. | |
* | |
* Based from the WordPress Downloader | |
* http://www.farinspace.com/wordpress-downloader/ | |
* | |
* @package wordpress-prep | |
* @version 1.0.1 | |
* @author Jared Atchison |
<?php | |
add_filter( 'genesis_build_crumbs', 'gj_wrap_last_breadcrumb', 10, 2 ); | |
/** | |
* Wrap the last Genesis breadcrumb in a span for styling. | |
* | |
* @author Gary Jones | |
* | |
* @param array $crumbs Existing HTML markup for the breadcrumbs. | |
* |
phpcs.standard = WordPress | |
phpcs.tabWidth = 4 | |
phpcs.encoding = utf-8 | |
ftp.host = ftp.example.com | |
ftp.port = 21 | |
ftp.username = username | |
ftp.password = password | |
ftp.project.dir = /subdomains/docs/httpdocs/${project.name.safe} | |
ftp.dir = ${ftp.project.dir}/${project.version} |