This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Applies some basic typographic rules on text. | |
* | |
* @param {String} text Text the rules should be applied on | |
* @param {Boolean} removeEmpty Whether to remove empty <p>s | |
* @returns {String} Adjusted text | |
* @version 0.2 | |
* @author %AUTHOR% | |
*/ | |
typography: function (text, removeEmpty) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//truncation | |
//------------- | |
$ext = end( explode( '.', $filename ) ); | |
$filename = substr( $filename, 0, -(strlen($ext) + 1) ); | |
$filename = str_replace( '.', '-', $filename ); | |
$filename_shortened = substr( $filename, 0, 70 ); | |
if ( $filename_shortened != $filename ) { | |
$filename = preg_replace( '~(-|_)[^\-_]{0,' . floor( strlen($filename) / 2 ) . '}$~', '', $filename_shortened ); | |
} | |
$filename = trim( $filename, '-_' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//try http://example/wp-json/sap/v1/angular | |
function sap_rest_angular( $data ) { | |
$json = new stdClass(); | |
// bloginfo | |
$json->bloginfo = new stdClass(); | |
$json->bloginfo->name = get_bloginfo('name'); | |
$json->bloginfo->description = get_bloginfo('description'); | |
//$json->bloginfo->wpurl = get_bloginfo('wpurl'); | |
//$json->bloginfo->url = get_bloginfo('url'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#common | |
Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.avvo.com *.bbb.org *.facebook.net *.google-analytics.com *.google.com *.googleadservices.com *.googlesyndication.com *.googletagmanager.com *.gravatar.com *.gstatic.com *.newrelic.com *.nr-data.net *.olark.com *.twitter.com *.wp.com *.youtube.com *.ytimg.com *.cloudflare.com *.amazonaws.com *.googleapis.com; style-src 'unsafe-inline' * data:; img-src * data:; font-src 'unsafe-inline' * data:; frame-src 'self' *.avvo.com *.bbb.org *.doubleclick.net *.facebook.com *.googletagmanager.com *.olark.com *.wp.com *.youtube.com akismet.com example.com; child-src 'self' *.avvo.com *.bbb.org *.doubleclick.net *.facebook.com *.googletagmanager.com *.olark.com *.wp.com *.youtube.com akismet.com example.com; object-src 'none'; connect-src 'self' *.akismet.com *.bbb.org *.google.com *.olark.com akismet.com;" | |
#common+issuu | |
Header set Content-Security-Policy "default-src 'self'; script-src 'self' ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
// Generates a strong password of N length containing at least one lower case letter, | |
// one uppercase letter, one digit, and one special character. The remaining characters | |
// in the password are chosen at random from those four sets. | |
// | |
// The available characters in each set are user friendly - there are no ambiguous | |
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option, | |
// makes it much easier for users to manually type or speak their passwords. | |
// | |
// Note: the $add_dashes option will increase the length of the password by |
NewerOlder