How to wait for a endpoint response in Playwright?

// https://playwright.dev/docs/api/class-page#page-wait-for-response
// https://playwright.dev/docs/api/class-response

import { test, expect } from "@playwright/test";

const PAGE_URL = "https://www.bstackdemo.com/";
const API_URL = "https://www.bstackdemo.com/api/products";

test("Order By Lowest to Highest should sort items in descending order by price", async ({
  page,
}) => {
  await page.goto(PAGE_URL);
  const dropdown = page.getByRole("combobox");
  await dropdown.selectOption({ value: 

How to get an array that contains the text values for all matching nodes in Playwright?

// https://playwright.dev/docs/api/class-locator#locator-all-text-contents

const texts = await page.getByRole('link').allTextContents();

Custom config for MariaDB

#/etc/mysql/mariadb.conf.d/99-custom.cnf
# for 1Gb RAM
# for lightweight OLTP
[mysqld]

# ---------------------------
# BASIC
# ---------------------------
bind-address = 127.0.0.1
skip-name-resolve
max_connections = 40
thread_cache_size = 16

# ---------------------------
# MEMORY CONTROL (1GB RAM)
# ---------------------------
innodb_buffer_pool_size = 512M
innodb_buffer_pool_instances = 1
innodb_log_file_size = 256M
innodb_log_buffer_size = 32M

tmp_table_size = 32M
max_heap_table_size = 32M

Optimize InnoDB tables in MariaDB

# Cron config
```cron
00 03 * * 1 /usr/local/bin/mariadb-optimize.sh
```
In MariaDB 10.6+, `OPTIMIZE TABLE` for InnoDB =
`ALTER TABLE ... FORCE`, i.e., rebuild table.\
**Do not do this often!!!**\
**Recommendation**: once a week during a low-load period.

Legit WU Transfer Bug MoneyGram Transfer CC Fullz PayPal Transfer CashApp Transfer Apple Pay Transfer Skrill Transfer..


__ LAZARUS GROUP___
 
 WORLD TIME SELLER   

 Fresh Logs Pricing
 ASIA/EU/UK/US Logs / Clean Bank Drops (GBP/$)
 10K GBP/$ = 250
 12K GBP/$ = 300
 16K GBP/$ = 350
 20K GBP/$ = 500
 30K GBP/$ = 800

 Verified • HQ Access • Fast Delivery
 DM for escrow or direct
WESTERN UNION / MONEY GRAM/BANKS LOGINS/BANK TRANFERS/PAYPAL TRANSFERS WORLDWIDE/CASHAPP/ZELLLE/APPLE PAY/SKRILL/VENMO TRANSFER
Telegram:@lazarustoolz     
Group: https://t.me/+LE893Ma2vIwyYWNk
Group: https://t.me/+2__ynBAtFP00M2Fk

HELLO

Healthcheck for MariaDB

#!/bin/bash
#/usr/local/bin/mariadb-healthcheck.sh

DB_USER="healthcheck"
DB_PASS="strong_password_here"
SOCKET="/run/mysqld/mysqld.sock"

LOG_FILE="/var/log/mariadb-healthcheck.log"
DATE=$(date '+%Y-%m-%d %H:%M:%S')

# Ping сервісу
mysqladmin --user="$DB_USER" --password="$DB_PASS" --socket="$SOCKET" ping > /dev/null 2>&1

if [ $? -ne 0 ]; then
    echo "$DATE - MariaDB ping failed. Attempting restart..." >> $LOG_FILE

    systemctl restart mariadb.service
    sleep 5

    mysqladmin --user="$D

Add systemd auto-restart

## Add systemd auto-restart
- Create override config file: \
`touch /etc/systemd/system/mariadb.service.d/auto-restart.conf`
- Add to the file follow text: 
```systemd
[Service]
Restart=always
RestartSec=5s
```      
- apply changes of unit and restart unit: \
`systemctl daemon-reload`\
`systemctl restart mariadb.service`

GeoIpUpdater by MaxMind: install and configure


## Install geoipupdater
- Install PPA \
`sudo add-apt-repository ppa:maxmind/ppa`
- Install package \
`sudo apt update && sudo apt install geoipupdate -y`

## Configure geoipupdater
- Log in to [maxmind.com](https://www.maxmind.com/en/home)
- Get your [config file](https://www.maxmind.com/en/accounts/current/license-key/GeoIP.conf)
- Get or generate new license key from [here](https://www.maxmind.com/en/accounts/current/license-key)
- Add/Replace/Uncomment in your GeoIP.conf:
    - **license ke

1680. Concatenation of Consecutive Binary Numbers

Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 109 + 7.
/**
 * @param {number} n
 * @return {number}
 */
var concatenatedBinary = function(n) {
    const MOD = 1_000_000_007;
    let ans = 0;
    let bitLength = 0;
    let pow2 = 1; // this will always store 2^bitLength % MOD

    for (let i = 1; i <= n; i++) {
        // If i is a power of two, bitLength increases
        if ((i & (i - 1)) === 0) {
            bitLength++;
            pow2 = (pow2 * 2) % MOD; // update 2^bitLength safely
        }

        // Shift left by multiplying with pow2 (ins

Maven Plugin - FatJar

Erestellt eine FatJar In BUILD | PLUGIN Sektion der pom.xml <build> <plugins> ... </plugins> </build>
<build>
  <plugins>
      <!-- FatJar -MVN-Plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
    

how to check if a the dropdown options are sorted?

test("Dropdown should be sorted in alphabetical order", async ({ page }) => {
    await page.goto(PAGE_URL);
    const dropdown = page.getByRole("combobox").and(page.locator("#country"));
    const options = await dropdown.locator("option").all();
    const optionValues = await Promise.all(options.map(option => option.textContent()));
    const sortedOptionValues = [...optionValues].sort();
    expect(optionValues).toEqual(sortedOptionValues);
});

How to run test on Playwright and see the test on the browsers

// adding --headed option
npx playwright test tests/singleSelectDropdown.spec.ts --headed

How to select a select element in playwright?

// page.getByRole("combobox")
test("Single select dropdown actions", async ({ page }) => {
  await page.goto(PAGE_URL);
  const dropdown = page.getByRole("combobox").and(page.locator("#country"));
  await dropdown.selectOption("India");
});

How to select a select option in Playwright?

Selects one or multiple options in the <select> element with locator.selectOption(). You can specify option value, or label to select. Multiple options can be selected.

// Single selection matching the value or label
await page.getByLabel('Choose a color').selectOption('blue');

// Single selection matching the label
await page.getByLabel('Choose a color').selectOption({ label: 'Blue' });

// Multiple selected items
await page.getByLabel('Choose multiple colors').selectOption(['red', 'green', '

cn, cva, clx

// 1 install
npm install class-variance-authority clsx tailwind-merge

// 2 /lib/utils.ts
/*
clsx handles conditional logic and class composition
tailwind-merge removes conflicting Tailwind classes
*/

import { clsx } from "clsx"
import { twMerge } from "tailwind-merge"

cn("px-2 px-4") // => "px-4"


// 3 variant with cva
import { cva } from "class-variance-authority"
import { cn } from "@/lib/utils"

const buttonVariants = cva(
  "rounded px-4 py-2 font-medium transition",
  {
    variants: {

Zustand

// 1 install
npm install zustand

// 2 create
// store.js
import { create } from 'zustand';

const useStore = create((set) => ({
  count: 0, // Initial state
  increase: () => set((state) => ({ count: state.count + 1 })),
  decrease: () => set((state) => ({ count: state.count - 1 })),
}));
export default useStore;

// 3 use
// App.js
import React from 'react';
import useStore from './store';

const Counter = () => {
  const { count, increase, decrease } = useStore((state) => ({
    count: state.