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
#In terminal execute | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 | |
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list | |
sudo apt-get update | |
sudo apt-get install mongodb-org | |
#Create /lib/systemd/system/mongodb.service with contents: | |
[Unit] | |
Description=High-performance, schema-free document-oriented database |
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
# QTRANSLATE CLEANUP QUERIES | |
# create temp column to separate post content on <!--more--> tag to simplify queries | |
ALTER TABLE `wp_posts` ADD `tmp_excerpt` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; | |
# split content | |
## fill `tmp_exceprt` column | |
UPDATE wp_posts SET tmp_excerpt = |
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
// | |
// Limpa wp_head(). | |
// | |
function wp_head_cleanup () { | |
// Remove Discovery. | |
remove_action('wp_head', 'rsd_link'); | |
// Remove Feed. | |
remove_action('wp_head', 'feed_links', 2); | |
remove_action('wp_head', 'feed_links_extra', 3); |
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
// | |
// 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 ); |
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
// | |
// 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 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 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 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 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 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); |
OlderNewer