fake Api for use in react

import { v4 as uuidv4 } from 'uuid';

const idOne = uuidv4();
const idTwo = uuidv4();
const idThree = uuidv4();

let users = {
     [idOne]: {
            id: idOne,
      firstName: 'Robin',
      lastName: 'Wieruch',
      isDeveloper: true,
    },
    [idTwo]: {
        id: idTwo,
      firstName: 'Dave',
      lastName: 'Davddis',
      isDeveloper: false,
    },
    [idThree]: {
        id: idThree,
        firstName: 'Paul',
        lastName: 'Weezy',
        isDevel

tinymc.js

<script>
        tinymce.init({
            license_key: 'gpl',
            selector: 'textarea#myeditorinstance', // Replace this CSS selector to match the placeholder element for TinyMCE
            plugins: 'code table lists image',
            toolbar: 'undo redo | blocks | bold italic | alignleft aligncenter alignright | indent outdent | bullist numlist | code | table | image',
            image_title: true,
            file_picker_types: 'image',
            image_uploadtab: true,

2751. Robot Collisions

There are n 1-indexed robots, each having a position on a line, health, and movement direction. You are given 0-indexed integer arrays positions, healths, and a string directions (directions[i] is either 'L' for left or 'R' for right). All integers in positions are unique. All robots start moving on the line simultaneously at the same speed in their given directions. If two robots ever share the same position while moving, they will collide. If two robots collide, the robot with lower health is removed from the line, and the health of the other robot decreases by one. The surviving robot continues in the same direction it was going. If both robots have the same health, they are both removed from the line. Your task is to determine the health of the robots that survive the collisions, in the same order that the robots were given, i.e. final heath of robot 1 (if survived), final health of robot 2 (if survived), and so on. If there are no survivors, return an empty array. Return an array containing the health of the remaining robots (in the order they were given in the input), after no further collisions can occur. Note: The positions may be unsorted.
/**
 * @param {number[]} positions
 * @param {number[]} healths
 * @param {string} directions
 * @return {number[]}
 */
var survivedRobotsHealths = function(positions, healths, directions) {
    // Create an array of robots, where each robot is represented as an object
    // with properties for its position, health, and direction.
    let robots = positions.map((position, i) => ({
        index: i,
        position: position,
        health: healths[i],
        direction: directions[i]
    }));

Vector

//Using vectors requires:

#include <vector>

//Initalizing a vector

std::vector<type> name;
std::vector<type> name = {100, 200}

//Vectors can be presized, in cases where values are unknown, but the amount of values are known
std::vector<tpye> name(2);

//Vectors can be output via their index
std::cout << name[0];

//To add a new element to the “back”, or end of the vector, we can use the .push_back() function
vectorName.push_back("value");

//To remove elements from the"back" of a vector you 

Unload command redshift

Unload the data from a redshift table to an s3 path
UNLOAD ('SELECT * FROM your_redshift_table')
TO 's3://your-bucket/path/to/export/'
IAM_ROLE 'arn:aws:iam::your-account-id:role/your-redshift-role'
FORMAT AS PARQUET;

Verificação Recaptcha Litespeed

<IfModule LiteSpeed>
RewriteRule wp-login.php - [E=verifycaptcha]
</IfModule>

1717. Maximum Score From Removing Substring

You are given a string s and two integers x and y. You can perform two types of operations any number of times. Remove substring "ab" and gain x points. For example, when removing "ab" from "cabxbae" it becomes "cxbae". Remove substring "ba" and gain y points. For example, when removing "ba" from "cabxbae" it becomes "cabxe". Return the maximum points you can gain after applying the above operations on s.
/**
 * @param {string} s
 * @param {number} x
 * @param {number} y
 * @return {number}
 */
var maximumGain = function(s, x, y) {
    // Initialize total points to 0
    let points = 0;

    // Create an empty stack to keep track of characters
    let stack = [];

    // Determine the order of 'a' and 'b' based on the values of x and y
    let [first, second, firstPoints, secondPoints] = x > y ? ['a', 'b', x, y] : ['b', 'a', y, x];

    // First pass: Iterate over the string
    for (let char of 

SCSS custom bootstrap variables in Laravel Livewire


// resources/sass/_variables.scss
// Body
$body-bg: #f8fafc;

// CUSTOM Typography
$font-family-sans-serif: 'SegoeUI', sans-serif;
$font-size-base: 1rem;
$line-height-base: 1.6;
$border-radius: 0.7rem;


// CUSTOM STYLES
$pagination-active-bg: #00aef4;
$data-bs-theme:  #00aef4;
$bs-link-color-rgb : rgb(0 174 244) ;


// Change link color Globally, backend and frontend
$link-color: #00aef4; // Custom link color based on logo light blue color
$link-hover-color: darken($link-color, 10%); // Option

Example EartH JSON

{
    "data": [{
        "age_limit": " This is a 14+ event. All attendees under 14-17s must be accompanied by a responsible adult who is 18 or older (1:1 ratio). To verify age, ID may be requested. We advise all customers to bring valid ID. For further information, see Age and ID in FAQs. Right of admission reserved. ",
        "promoters": [{
            "id": 11564,
            "name": "EartH"
        }],
        "url": "https://link.dice.fm/Jc8a7d7a9772",
        "address": "11 Stoke Newingt

Работа с портами в linux

## Сделать публичными порты 10050, 10051 - нужны для zabbix (server, agent)

```bash
sudo iptables -A INPUT -p tcp --dport 10050 -j ACCEPT
sudo ip6tables -A INPUT -p tcp --dport 10051 -j ACCEPT
```

или 

```bash
sudo ufw allow 10050/tcp
sudo ufw allow 10051/tcp
sudo ufw reload
```

```bash
// Добавление порта 21 в разрешенные
sudo iptables -A INPUT -p tcp --dport 21 -j DROP
// УБрать 21 порта из разрешенных
sudo iptables -D INPUT -p tcp --dport 21 -j DROP
```

## Проверить доступные порты

Пров

How to install scraping TigerVNC

# How to install scraping TigerVNC

## Base server installation

Install the base server application:

```
$ sudo apt update
$ sudo apt install tigervnc-scraping-server
```

Then, configure the service. First set the connection password:

```
$ vncpasswd
```

This command will run a wizard to configure the user and the password for the connection.

```
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
```

The password file is stored in the ```~/.vn

mongodb-data.api server

const express = require('express');
const axios = require('axios');
require('dotenv').config();

const app = express();
app.use(express.json());

const { ATLAS_API_KEY, ATLAS_DATA_SOURCE, ATLAS_CLUSTER, ATLAS_DATABASE } = process.env;

const ATLAS_API_URL =https://data.mongodb-api.com/app/${ATLAS_CLUSTER}/endpoint/data/v1/actionconst headers = {
    'Content-Type': 'application/json',
    'api-key': ATLAS_API_KEY,
};

// Example route to get data from MongoDB
app.get('/api/data', async (req, res

Toast Notification | Toast Container Customized

"use client";
import { ToastContainer, TypeOptions } from "react-toastify";
import {
  FaCircleXmark,
  FaCircleCheck,
  FaCircleInfo,
  FaCircleExclamation,
} from "react-icons/fa6";

const toastColor = (type: TypeOptions | undefined) => {
  switch (type) {
    case "success":
      return "bg-lime-200 shadow-lime-100 text-lime-800";
    case "error":
      return "bg-rose-200 shadow-rose-100 text-rose-800";
    case "info":
      return "bg-sky-200 shadow-sky-100 text-sky-800";

CRUD: Create, Replace, Update, Delete

### Create
You will notice this option comes with a green icon. Green is Good! Right? Green actually indicates that this action is very low impact and low risk–it’s a “safe” move. E.g. If this mapping or connection does not exist, then create it.  Otherwise, if it does exist, then do nothing. But if you’re trying to use this during a migration, you might not get the result you want. You might not get your objects to show up, or you could get duplicate objects, depending on the situation. It’s g

Laravel Mailtrap Demo


https://mailtrap.io/blog/send-email-in-laravel/

1190. Reverse Substrings Between Each Pair of Parentheses

You are given a string s that consists of lower case English letters and brackets. Reverse the strings in each pair of matching parentheses, starting from the innermost one. Your result should not contain any brackets.
/**
 * @param {string} s
 * @return {string}
 */
var reverseParentheses = function(s) {
    let stack = [[]]; // Initialize a stack with one level
    for (let c of s) { // Iterate through the string
        if (c === '(') {
            stack.push([]); // Start a new level in the stack
        } else if (c === ')') {
            let reversed = stack.pop().reverse(); // End the level and reverse it
            stack[stack.length - 1].push(...reversed); // Append reversed string to the next level