WordPress current URL Cheat Sheet

Input https://juzhax.com/page-name/page/3/?query=data Currrent URL with Pagination and Query String $final_url = "{$parts[‘scheme’]}://{$parts[‘host’]}" . add_query_arg( NULL, NULL ); // Result : https://juzhax.com/page-name/page/3/?query=data Current URL without Query String and ending with slash $current_url = home_url( $wp->request ); $final_url = trailingslashit( $current_url ); or $final_url = get_permalink(); or $final_url = get_page_link(); // If it is page. // Result : https://juzhax.[…]

WordPress current URL Cheat Sheet Read More »

error: #error This file requires compiler and library support for the ISO C++ 2011 standard

I would like to use #include <unordered_set> in my cpp coding, but it show error when I compile. error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. Solution Before you compile, or run do this first. cmake CMakeLists.txt Then add this in your CMakeList.txt file SET(CMAKE_CXX_FLAGS "-std=c++11 -O3") Then try to compile again. Good Luck.

error: #error This file requires compiler and library support for the ISO C++ 2011 standard Read More »

Hints on import big sql 50GB above to MariaDB or MySQL

Access to MySQL You have to be root to set those settings # mysql -u root -p Maximize all Buffer and Packet Set network buffer length to a large byte number and set maximum allowed packet size to a large byte number set global net_buffer_length=1048576; set global max_allowed_packet=1073741824; SET foreign_key_checks = 0; SET UNIQUE_CHECKS = 0; SET AUTOCOMMIT = 0; Import your SQL file Import your sql dump file, you can import more than one file source file-to-import.sql; Set back to default Reme[…]

Hints on import big sql 50GB above to MariaDB or MySQL Read More »

Unauthorized dropDatabase in MangoDB

Normally when you want to drop a database in MongoDB, you just need these command. > use mydatabase; switched to db mydatabase > db.dropDatabase(); Error message with Unauthorized But when you see this error, it mean you are not authorized and not enough level access to run the command. Drop database in MongoDB, you need MongoDB root role. { "ok" : 0, "errmsg" : "not authorized on mydatabase to execute command { dropDatabase: 1.0, writeConcern: { w: \"majority\", wtimeout: 600000.0 }, lsid[…]

Unauthorized dropDatabase in MangoDB Read More »