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
DROP FUNCTION IF EXISTS `slug`; | |
DELIMITER // | |
CREATE FUNCTION `slug`(`str` TEXT) | |
RETURNS text | |
LANGUAGE SQL | |
DETERMINISTIC | |
NO SQL | |
SQL SECURITY INVOKER | |
COMMENT '' |
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
<VirtualHost *:80> | |
ServerName nome-do-servidor.com.br | |
ServerAdmin webmaster@localhost | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
ProxyPass / http://127.0.0.1:8082/ | |
ProxyPassReverse / http://127.0.0.1:8082/ |
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
SELECT | |
@rownum := @rownum + 1 AS rownumber | |
FROM | |
(SELECT @rownum := 0) AS tbl_rownumber |
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 | |
$key = 'your-secret-key-here'; | |
$header = [ | |
'typ' => 'JWT', | |
'alg' => 'HS256' | |
]; | |
$header = json_encode($header); | |
$header = base64_encode($header); |
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
for branch in `git branch -r | cut -d '/' -f2` ; do git checkout $branch && git pull origin $branch ; done |
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
mysqldump <DATABASE> --host=<HOST_IP> \ | |
--user=<USER> \ | |
--password=<PASSWORD> \ | |
--port=3306 \ | |
--single-transaction \ | |
--compress \ | |
--skip-comments \ | |
--skip-add-locks \ | |
--skip-triggers \ | |
--no-create-db \ |
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
mysqldump <DATABASE> --host=<IP_HOST> \ | |
--user=<USER> \ | |
--password=<PASSWORD> \ | |
--port=3306 \ | |
--single-transaction \ | |
--routines \ | |
--triggers \ | |
--compress \ | |
--no-set-names \ | |
--skip-add-locks \ |
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
// | |
// Remove menus do admin | |
// | |
function remove_menus(){ | |
remove_menu_page( 'index.php' ); //Dashboard | |
//remove_menu_page( 'edit.php' ); //Posts | |
remove_menu_page( 'upload.php' ); //Media | |
//remove_menu_page( 'edit.php?post_type=page' ); //Pages | |
remove_menu_page( 'edit-comments.php' ); //Comments | |
remove_menu_page( 'link-manager.php' ); //Links |
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
// | |
// Remove aviso de atualização | |
// Obs: Aparenta deixar o admin um pouco mais lento para mudar de página | |
// | |
remove_action( 'load-update-core.php', 'wp_update_plugins' ); | |
add_filter( 'pre_site_transient_update_core', create_function('$a', "return null;") ); | |
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) ); |
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
// | |
// Enqueue Styles e Scripts. | |
// | |
function render_css( $name, $path ) { | |
if ( preg_match('/^(\/\/|http)/', $path ) ) { | |
wp_enqueue_style( $name, $path ); | |
} else if ( file_exists( get_template_directory() . $path ) ) { | |
$hash = md5_file( get_template_directory() . $path ); | |
$path = get_template_directory_uri() . $path; | |
wp_enqueue_style( $name, $path, array(), $hash ); |