This file contains 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 | |
add_filter( 'rest_endpoints', 'disable_default_endpoints' ); | |
function disable_default_endpoints( $endpoints ) { | |
$allowed = ['/some/route/here']; | |
foreach ( $endpoints as $maybe_endpoint => $object ) { | |
if ( ! in_array($maybe_endpoint, $allowed) ) { |
This file contains 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
RewriteRule ^wp-admin/includes/ - [F,L] | |
RewriteRule !^wp-includes/ - [S=3] | |
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L] | |
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L] | |
RewriteRule ^wp-includes/theme-compat/ - [F,L] | |
RewriteRule (vendor|node_modules) - [R=404,L,NC] | |
RewriteRule Gruntfile.js - [R=404,L,NC] | |
RewriteRule gulpfile.js - [R=404,L,NC] | |
RewriteRule package.json - [R=404,L,NC] |
This file contains 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
<files *.ini> | |
order allow,deny | |
deny from all | |
</files> | |
<files *.sh> | |
order allow,deny | |
deny from all | |
</files> |
This file contains 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 | |
add_action('admin_init', function () { | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ($pagenow === 'edit-comments.php') { | |
wp_redirect(admin_url()); | |
exit; | |
} |
This file contains 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
[XDebug] | |
zend_extension = "c:\xampp\php\ext\php_xdebug.dll" | |
xdebug.remote_autostart = 1 | |
xdebug.profiler_append = 0 | |
xdebug.profiler_enable = 1 | |
xdebug.profiler_enable_trigger = 0 | |
xdebug.profiler_output_dir = "c:\xampp\tmp" | |
;xdebug.profiler_output_name = "cachegrind.out.%t-%s" | |
xdebug.remote_enable = 1 | |
xdebug.remote_handler = "dbgp" |
This file contains 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
for line in `cat file.csv | sed -e 's/\r//g'`; do qrencode -o ${line}.png -s 10 ${line}; done |
This file contains 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
// drawnImage : UIImage | |
let imgData = drawnImage.jpegData(compressionQuality: 1.0) | |
let base64 = imgData?.base64EncodedString() |
This file contains 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
import UIKit | |
extension UIImage { | |
public func imageRotatedByDegrees(degrees: CGFloat, flip: Bool) -> UIImage { | |
let radiansToDegrees: (CGFloat) -> CGFloat = { | |
return $0 * (180.0 / CGFloat.pi) | |
} | |
let degreesToRadians: (CGFloat) -> CGFloat = { | |
return $0 / 180.0 * CGFloat.pi |
This file contains 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
for SERIAL in $(adb devices | grep -v List | cut -f 1); do adb -s $SERIAL install -r nome-do-arquivo-do-app.apk; done |
This file contains 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 | |
header('Content-Type: application/json'); | |
$body = file_get_contents("php://input"); | |
$bodyjson = json_decode($body); | |
$number1 = $bodyjson->queryResult->parameters->number1; | |
$number2 = $bodyjson->queryResult->parameters->number2; | |
$action = $bodyjson->queryResult->action; | |
$result = 0; |
NewerOlder