Skip to content

Instantly share code, notes, and snippets.

Nginx не має файлу конфігурації на рівні каталогу, як файл .htaccess в Apache, який потрібен для роботи CompressX. Усі налаштування на сервері Nginx мають виконуватися адміністратором на рівні сервера.

У цьому посібнику ми покажемо вам, як налаштувати Nginx для роботи CompressX.

Крок 1: Підключення до сервера

Встановіть SSH-з’єднання з вашим веб-сайтом. Ви можете зробити це за допомогою SSH-клієнта, такого як PuTTY.

Крок 2: Знайдіть файл конфігурації

Знайдіть та відкрийте файл конфігурації, який використовується вашим доменом, за допомогою команди нижче:

<?php
/**
* Plugin Name: Block Usage Checker
* Description: Advanced block usage analytics with widgets and theme customizer support. Performance Optimized.
* Version: 2.1
* Author: turovskiy
*/
if (!defined("ABSPATH")) {
exit(); // Exit if accessed directly.
@turovskiy
turovskiy / api.php
Created February 20, 2025 05:36 — forked from igorbenic/api.php
How to use PHP Namespaces in WordPress Plugins | https://www.ibenic.com/php-namespaces-wordpress-plugins
<?php
namespace My_Plugin\API;
/**
* API Functions
*/
if( ! defined( 'ABSPATH' ) ) {
return;
}
@turovskiy
turovskiy / edit.js
Created February 20, 2025 05:32 — forked from igorbenic/edit.js
Gutenberg Components: ServerSideRender https://ibenic.com/gutenberg-components-server-side-render
/**
* WordPress dependencies
* https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/archives/edit.js
*/
// ... hidden code for tutorial purposes
import ServerSideRender from '@wordpress/server-side-render';
export default function ArchivesEdit( { attributes, setAttributes } ) {
const { showPostCounts, displayAsDropdown } = attributes;
<!DOCTYPE html>
<html lang="en">
<head>
<title>Your Page Title</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Your name">
<meta name="description" content="Brief description">
<meta property="og:title" content="Your Page Title">
<meta property="og:description" content="Brief description">
#!/bin/bash
# Зупиняємо і видаляємо Docker контейнери
echo "Зупиняємо Docker контейнери..."
cd ~/myapp
sudo docker-compose down
# Видаляємо SSL сертифікати для старого домену
echo "Видаляємо старі SSL сертифікати..."
sudo certbot delete --cert-name nextselfhost.dev # замініть на ваш старий домен
@turovskiy
turovskiy / 01 - Setup Nextjs site on Ubuntu Server - Terminal commands
Created September 21, 2024 08:19 — forked from oelbaga/01 - Setup Nextjs site on Ubuntu Server - Terminal commands
Setup NextJS app on Digital Ocean Ubuntu server Full Terminal Commands Step by Step
#Setup NextJS on Ubuntu server (Digital Ocean, EC2,...) Terminal Commands
#based on my YouTube video
#Recommended: An ubuntu server with at least 2 GB memory to handle npm run build
#login to server
ssh root@ip_address
#Upgrade Server - may take a few minutes
sudo apt update
sudo apt upgrade
@turovskiy
turovskiy / submit.md
Created December 12, 2023 07:11 — forked from tanaikech/submit.md
Downloading Google Spreadsheet as XLSX and PDF file by Clicking Button

Downloading Google Spreadsheet as XLSX and PDF file by Clicking Button

This is a sample script for downloading Google Spreadsheet to the local PC as a XLSX file and a PDF file when a button on the side bar and the dialog is clicked. This is created with Google Apps Script and HTML&Javascript.

Sample script

Please create new Google Spreadsheet and copy and paste the following scripts to the script editor. And please run openSidebar(). By this, the side bar is opened to the Spreadsheet.

@turovskiy
turovskiy / README.md
Created December 4, 2023 13:20 — forked from manzoorwanijk/README.md
Google Script to bypass the blockage of Telegram Bot API from by webhost

WPTelegram Google Script

You can use this script to bypass the bans on Telegram API by different hosts. Simply send the request to this script instead of the Telegram Bot API after deploying it as a web app and allowing anonymous access.

Params

It accepts bot GET and POST requests with the following params

name type Description

Frameworks like React require that when you change the contents of an array or object you change its reference. Or push another way that you don't change arrays but instead create new arrays with updated values (i.e. immutability).

There are older array methods that are incompatible with immutability because they alter the array in place and don't change the array reference. These are mutable (or destructive) methods.

Shown below are replacements for the array destructive methods (e.g. push, pop, splice, sort, etc.) that will create new array references with the updated data.

Solutions are provided using the spread operator and also the newer "change array by copy" methods (toSpliced, toSorted, toReversed and with).

Setting Value At Index