MONGODB_URI=

mongodb+srv://weezy:weezy@cluster0.4so3vbh.mongodb.net/

snippet app react

npx create-react-router@latest snippet-app
cd snippet-app
npm i highlight.js @tabler/icons-webfont
npm i -D @vitejs/plugin-rsc vite-tsconfig-paths

snippet manager html

  <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Snippet library</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@3.0.0/dist/tabler-icons.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<style>
  :root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f4;
    --text-primary: #1c1917;
   

🤖🖥️ ACI - Constraints VS Guardrails

# Constraints vs Guardrails — Fiche synthèse ACI

> **Statut épistémique** : la distinction Constraints/Guardrails est explicite dans la source (ACI-knowledge.md, §3). La **catégorisation des Guardrails ci-dessous n'est PAS dans la source** — c'est une extension pédagogique cohérente avec l'esprit du document. À utiliser comme grille de lecture, pas comme citation faisant autorité.

---

## 1. Vue comparée

| | **Constraints** | **Guardrails** |
|---|---|---|
| **Nature** | Élément de **design**

port端口占用查询

Get-NetTCPConnection -State Listen | Where-Object { $_.OwningProcess -in (Get-Process node -ErrorAction SilentlyContinue).Id } | Select-Object LocalPort, OwningProcess

nav link button with drop downs

@media (min-width: 1024px) {
  .dropdown.menu.large-horizontal>li.is-dropdown-submenu-parent>a {
    color: white;
  }
  .nav-btn.menu-item > a {
    color: var(--button-font-color, #fefefe)!important;
    background-color: var(--button-background-color, --primary-color)!important;
    margin-left: 15px;
    padding: 0.5rem 1rem !important;
    transition: 300ms all ease;
    &:hover {
      color: var(--button-font-color-hover)!important;
      background-color: var(--button-background-color-ho

2540. Minimum Common Value

Given two integer arrays nums1 and nums2, sorted in non-decreasing order, return the minimum integer common to both arrays. If there is no common integer amongst nums1 and nums2, return -1. Note that an integer is said to be common to nums1 and nums2 if both arrays have at least one occurrence of that integer.
/**
 * @param {number[]} nums1
 * @param {number[]} nums2
 * @return {number}
 */
var getCommon = function(nums1, nums2) {
    // Two pointers starting at the beginning of each sorted array
    let i = 0;
    let j = 0;

    // Walk both arrays while both pointers are in bounds
    while (i < nums1.length && j < nums2.length) {

        // If both values match, we've found the smallest common value
        if (nums1[i] === nums2[j]) {
            return nums1[i];
        }

        // If nums1's

Configuring Drizzle with Supabase #Drizzle #Supabase

Configuring Drizzle with Supabase #Drizzle #Supabase
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
import * as schema from "./schema";
import { envs } from "@/config/envs";

const globalForDrizzle = global as unknown as {
  db: ReturnType<typeof drizzle>;
  client: ReturnType<typeof postgres>;
};

/**
 * When configuring Drizzle with Supabase the property `prepare` must be FALSE.
 * https://supabase.com/docs/guides/database/drizzle
 */
const client =
  globalForDrizzle.client ?? postgres(envs.DATABASE_URL, { p

Touch events - swipe button

const button = document.getElementById("swipe-button");
const container = document.getElementById("swipe-container");
let startX = 0;

button.addEventListener("touchstart", (e) => {
  startX = e.touches[0].clientX;
});

button.addEventListener("touchmove", (e) => {
  const currentX = e.touches[0].clientX;
  const offset = Math.min(
    container.offsetWidth - button.offsetWidth,
    currentX - startX
  );
  button.style.transform = `translateX(${offset}px)`;
});

button.addEvent

How to group tests in playwright?

// using the descript method

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

test.describe('two tests', () => {
  test('one', async ({ page }) => {
    // ...
  });

  test('two', async ({ page }) => {
    // ...
  });
});

How to executing specific groups of tests

npx test filename.spec.ts --grep groupName

emergente PHP


// Ejemplo de instanciar contenido dinámicamente y pasarle parámetros



$s.=$Plugins->botones(["_escritura"=>true,
	"botones"=>[
		"menu2"=>[
			"rotulo"=>"Abrir emergente con fecha",
			"ayuda"=>"Este emergente es para ver si carga hammer.js",
			"tipo" => "normal",
			"tamaño" => 2,
			"emergente"=>[
				"titulo"=>"Instancia Quontrol en Emergente",
				"api"=>["api"=>"SoporteAplicaciones.insertaEditor", 
					"carga_id"=> 6,
					"parametros"=>[
						"campo"=>"fecha",
						"tipo"=>"fecha2"

1345. Jump Game IV

Given an array of integers arr, you are initially positioned at the first index of the array. In one step you can jump from index i to index: i + 1 where: i + 1 < arr.length. i - 1 where: i - 1 >= 0. j where: arr[i] == arr[j] and i != j. Return the minimum number of steps to reach the last index of the array. Notice that you can not jump outside of the array at any time.
/**
 * @param {number[]} arr
 * @return {number}
 */
var minJumps = function(arr) {
    const n = arr.length;
    if (n === 1) return 0;

    // Map value -> list of indices
    const map = new Map();
    for (let i = 0; i < n; i++) {
        if (!map.has(arr[i])) map.set(arr[i], []);
        map.get(arr[i]).push(i);
    }

    const queue = [0];
    const visited = new Array(n).fill(false);
    visited[0] = true;

    let steps = 0;

    while (queue.length > 0) {
        const size = queue.len

how to retry test from the terminal in Playwright

# https://playwright.dev/docs/test-retries#retries
npx playwright test --retries=3

massed compute cupon

JonDurbin

1306. Jump Game III

Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + arr[i] or i - arr[i], check if you can reach any index with value 0. Notice that you can not jump outside of the array at any time.
/**
 * @param {number[]} arr
 * @param {number} start
 * @return {boolean}
 */
var canReach = function(arr, start) {
    const n = arr.length;
    const queue = [start];
    const visited = new Array(n).fill(false);
    visited[start] = true;

    while (queue.length > 0) {
        const i = queue.shift();

        // If we reached a zero, we're done
        if (arr[i] === 0) return true;

        // Try both directions
        const next1 = i + arr[i];
        const next2 = i - arr[i];