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
| # Add Meilisearch package | |
| echo "deb [trusted=yes] https://apt.fury.io/meilisearch/ /" | sudo tee /etc/apt/sources.list.d/fury.list | |
| # Update APT and install Meilisearch | |
| sudo apt update && sudo apt install meilisearch | |
| # Launch Meilisearch | |
| meilisearch | |
| cd /etc/systemd/system/ |
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
| package main | |
| import ( | |
| "net/http" | |
| "website/utils/validation" | |
| "github.com/gin-gonic/gin" | |
| "github.com/go-playground/validator/v10" | |
| ) |
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
| class Custom_Category_Walker extends Walker_Category | |
| { | |
| function start_el(&$output, $category, $depth = 0, $args = null, $id = 0) | |
| { | |
| $current_category = get_queried_object(); | |
| $active_category = esc_attr($category->slug) == $current_category->slug ? 'active' : ''; | |
| $cat_name = esc_attr($category->name); | |
| $cat_id = esc_attr($category->term_id); |
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
| function recent_posts_list($number_of_posts = 5) | |
| { | |
| $args = array( | |
| 'post_type' => 'post', | |
| 'posts_per_page' => $number_of_posts, | |
| 'order' => 'DESC', | |
| ); | |
| $recent_posts = new WP_Query($args); |
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 | |
| $args = array( | |
| 'post_type' => 'post, | |
| ); | |
| $query = new WP_Query($args); | |
| if ($query->have_posts()) : | |
| while ($query->have_posts()) : | |
| $query->the_post(); |
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
| wp_list_categories(array( | |
| 'taxonomy' => 'post', // Replace 'category' with your custom taxonomy name | |
| 'title_li' => '', // Hide the "Categories" title | |
| 'orderby' => 'name', // Order categories by name | |
| 'show_count' => false, // Display category post counts | |
| 'hide_empty' => true, // Show empty categories | |
| 'exclude' => array(1), // Exclude a specific category ID | |
| )); |
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
| function load_posts() | |
| { | |
| $paged = $_POST['page']; | |
| $post_type = isset($_POST['post_type']) ? sanitize_text_field($_POST['post_type']) : 'post'; // Default to 'post' if not provided | |
| $args = array( | |
| 'post_type' => $post_type, | |
| 'paged' => $paged, | |
| ); | |
| $query = new WP_Query($args); |
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
| apt-get install zlib1g zlib1g-dev build-essential bzip2 unzip libpcre3-dev libssl-dev libgeoip-dev wget unzip libxslt-dev libgd-dev -y | |
| nginx -v | |
| wget http://nginx.org/download/nginx-1.19.6.tar.gz | |
| https://github.com/nbs-system/naxsi/releases | |
| wget https://github.com/nbs-system/naxsi/archive/$NAXSI_VER.tar.gz -O naxsi_$NAXSI_VER.tar.gz | |
| /nginx-X.YY.Z$ ./configure <FLAGS FROM ABOVE COMMAND> --add-dynamic-module=../naxsi-$NAXSI_VER/naxsi_src/ | |
| /nginx-X.YY.Z$ make modules |
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
| <template> | |
| <div> | |
| <h1>Your Vue.js App</h1> | |
| <div id="recaptchaContainer"></div> | |
| <button @click="submitForm">Submit</button> | |
| </div> | |
| </template> | |
| <script> | |
| import { useRecaptcha } from './composables/useRecaptcha'; |
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
| <h3>Order Number: {{ order_number }}</h3> | |
| <h3>Amount: {{ total_price | money_without_currency }}</h3> | |
| <h3>currency: {{ currency }}</h3> | |
| <h3>order status: {{ order.financial_status }}</h3> | |
| <h3>customer name: {{ order.customer.name }}</h3> | |
| <h3>item count: {{ order.item_count }}</h3> | |
| {% for product in order.line_items %} | |
| <li>id: {{ product.id }} | |
| <li>name: {{ product.title }} |