Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.
[Brief description ]
- [more description]
- [more description]
- [more description]
| $wp_customize->add_setting( 'themeslug_select_setting_id', array( | |
| 'capability' => 'edit_theme_options', | |
| 'sanitize_callback' => 'themeslug_sanitize_select', | |
| 'default' => 'value1', | |
| ) ); | |
| $wp_customize->add_control( 'themeslug_select_setting_id', array( | |
| 'type' => 'select', | |
| 'section' => 'custom_section', // Add a default or your own section | |
| 'label' => __( 'Custom Select Option' ), |
| # most people include something like this. don't. | |
| # check your default nginx.conf, it's already covered in a much better way. | |
| #gzip_disable "MSIE [1-6]\.(?!.*SV1)"; | |
| # compress proxied requests too. | |
| # it doesn't actually matter if the request is proxied, we still want it compressed. | |
| gzip_proxied any; | |
| # a pretty comprehensive list of content mime types that we want to compress | |
| # there's a lot of repetition here because different applications might use different |
| input { | |
| stdin { | |
| } | |
| } | |
| filter { | |
| mutate { | |
| replace => { | |
| "type" => "nginx-error" | |
| } |
Never forget this
The API we are creating in this gist will follow these rules :
password Grant Type only (no need for Authorization pages and such).v1.api.example.com)The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :
| <?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" /> |
| input { | |
| file { | |
| path => "/var/log/nginx/access.log" | |
| type => "nginx-access" | |
| sincedb_path => "/var/log/.nginxaccesssincedb" | |
| } | |
| } | |
| input { | |
| file { | |
| path => "/var/log/nginx/error.log" |
| # This is the simplest definition, with the addition of a type | |
| input { | |
| udp { | |
| port => 25826 # Must be specified. 25826 is the default for collectd | |
| buffer_size => 1452 # Should be specified. 1452 is the default for recent versions of collectd | |
| codec => collectd { } # This will invoke the default options for the codec | |
| type => "collectd" | |
| } | |
| } |