use cases - computed properties

<template>
  <div>
    <ul>
      <li v-for="item in cartItems" :key="item.id">
        {{ item.name }} - {{ item.price }} - Quantity: {{ item.quantity }}
      </li>
    </ul>
    <p>Total Price: {{ totalPrice }}</p>
    <p>Total Quantity: {{ totalQuantity }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      cartItems: [
        { id: 1, name: 'Item 1', price: 10, quantity: 2 },
        { id: 2, name: 'Item 2', price: 15, quantity: 1 },
       

All events in javascript

Object.keys(window).forEach(key => {
  if (/^on/.test(key)) {
    window.addEventListener(key.slice(2), event => {
      console.log(event);
    });
  }
});

Trunk auto fix

If you're using **[Trunk](https://trunk.io)** (a dev tool that includes linting, formatting, etc.), and it detects auto-fixable lint issues, you can run the auto-fix with:

```bash
trunk check --fix
```

### Explanation:

* `trunk check`: runs the Trunk pipeline (linters, formatters, etc.)
* `--fix`: automatically applies any fixes that the linters support (like ESLint or Prettier).

---

If you only want to fix issues for a specific linter (e.g., ESLint), you can run:

```bash
trunk check --fix

Docker container accessible via ssh

FROM ubuntu:24.10 AS base

# Install SSH server
RUN apt-get update && \
    apt-get install -y openssh-server && \
    mkdir -p /var/run/sshd

# Create user with password
RUN useradd -m docker && echo "docker:docker" | chpasswd

# Allow password login (not recommended for production)
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
    sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# Expose SSH port
EXPOSE 2

73. Set Matrix Zeroes

Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's. You must do it in place.
/**
 * @param {number[][]} matrix
 * @return {void} Do not return anything, modify matrix in-place instead.
 */
var setZeroes = function(matrix) {
    const rows = matrix.length;
    const cols = matrix[0].length;

    let firstRowHasZero = false;
    let firstColHasZero = false;

    // Check if the first row contains zero
    for (let c = 0; c < cols; c++) {
        if (matrix[0][c] === 0) {
            firstRowHasZero = true;
            break;
        }
    }

    // Check if the first colum

Pentaho Workspace for Ubuntu

FROM ubuntu:latest AS pentaho-setup
LABEL maintainer="Pentaho Data Integration" \
    description="Pentaho Data Integration (PDI) is a powerful, metadata-driven ETL tool that enables users to extract, transform, and load data from various sources into a target system." \
    version="10.2.0.0-222"
RUN apt -qq update && \
    apt -qq install -y default-jre gnupg lsb-release && \
    echo "deb http://cz.archive.ubuntu.com/ubuntu bionic main universe" >> /etc/apt/sources.list && \
    apt-key adv -

openwisp-controller

services:
  github-latest:
    stdin_open: true
    tty: true
    build: .
    command: /bin/bash
    volumes:
      - ./openwisp-controller:/opt/openwisp-controller
    ports:
      - 0.0.0.0:8000:8000
    depends_on:
      - redis
      - influxdb
  
  redis:
    image: redis:alpine
    command: redis-server --port 6379 &
    ports:
      - 6379:6379

  influxdb:
    image: influxdb:1.8-alpine
    volumes:
      - ./influxdb:/var/lib/influxdb
    ports:
      - "8086:8086"
    environment:
   

openwisp-radius

services:
  github-latest:
    stdin_open: true
    tty: true
    build: .
    command: /bin/bash
    volumes:
      - ./openwisp-radius:/opt/openwisp-radius
    ports:
      - 0.0.0.0:8000:8000
    depends_on:
      - redis
      - influxdb

  redis-openwisp-github:
    image: redis:alpine
    command: redis-server --port 6379 &
    ports:
      - 6379:6379

  influxdb-openwisp-github:
    image: influxdb:1.8-alpine
    volumes:
      - ./influxdb:/var/lib/influxdb
    ports:
      - 8086:8086

openwisp-wifi-login-pages

services:
  github-latest:
    stdin_open: true
    tty: true
    build: .
    command: /bin/bash
    volumes:
      - ./openwisp-wifi-login-pages:/opt/openwisp-wifi-login-pages
    ports:
      - 0.0.0.0:8080:8080
      - 0.0.0.0:3030:3030

Automatically open Pull Request

param(
    [string] $token,
    [string] $repositoryUrl,
    [string] $team,
    [string] $sourceBranch,
    [string] $targetBranch,
    [string] $slackNotificationChannelId,
    [switch] $lockSource,
    [switch] $noSquash
)

$ErrorActionPreference = "Stop"
$InformationPreference = "Continue"

$v = $PSVersionTable.PSVersion

if ($v -lt [Version]'7.2') {
    throw [System.Exception] "Powershell Version $v Unsupported - Please retry using version 7.2+"
}

$azureUrl = "https://dev.azure.com/myorg"

consultaMysqlMetabaseGLPI Tickets por Usuario

SELECT
    u.id AS "ID Usuario",
    CONCAT(u.firstname, ' ', u.realname) AS "Nombre Completo",
    COUNT(glpi_tickets.id) AS "Cantidad de Tickets Enviados"
FROM
    glpi_tickets
JOIN
    glpi_users u ON glpi_tickets.users_id_recipient = u.id
WHERE
    {{fecha_creacion}}  -- ← Sin alias aquí
GROUP BY
    u.id, u.firstname, u.realname
ORDER BY
    COUNT(glpi_tickets.id) DESC;

0. Welcome to Cacher

# Welcome to Cacher

We're delighted you've chosen Cacher to be your snippet organizer! Whether you're a solo developer or a member of your team, Cacher is here to help you organize and use snippets more efficiently.

Our users create snippets to:

- Remember project-specific algorithms
- Create cheatsheets for useful libraries
- Share knowledge with colleagues

Take a few minutes to look over our **Getting Started** snippets. To view more detailed information on features, you can visit [Cacher 

Ratio of proportions with uncertainty using confidence interval of Binomial distribution

def ratio_lossed_gained_uncertainty(num_lossed:int, 
                                    num_gained:int, 
                                    alpha:float = 0.01, 
                                    verbose:bool = False) -> tuple[float, float]:
    """Estimate ratio lossed / gained with statistical uncertainty

    Using confidence interval (CI) estimation for binomal estimation (loss, gain).
    NOTE> In this case lossed is win and gained is loss, that is, ratio = lossed / gained.

   

viewTransitionsAPIでSPA基本

<nav class="navigation">
  <ul class="list">
    <li class="item">
      <a href="index.html" class="link">野菜</a>
    </li>
    <li class="item">
      <a href="index2.html" class="link">肉</a>
    </li>
    <li class="item">
      <a href="index3.html" class="link">魚</a>
    </li>
    <li class="item">
      <a href="index4.html" class="link">米</a>
    </li>
    <li class="item">
      <a href="index5.html" class="link">パン</a>
    </li>
  </ul>
</nav>
<ul class="products">
  <li class="item">野菜1

vim tricks


#To convert any spaces to tabs in vim for the entire file, you can run:
:set noexpandtab
:retab!

#redo in vim 
Press Ctrl-R (hold Ctrl and press r) to redo the last undone change.
For example, typing 4Ctrl-R will redo the last four changes 

modal alert admin wordpress

<div class="notice notice-success is-dismissible">
    <p>Configuración guardada correctamente.</p>
    <button type="button" class="notice-dismiss">
        <span class="screen-reader-text">Dismiss this notice.</span>
    </button>
</div>

<div class="notice notice-error is-dismissible">
    <p>Ha ocurrido un error al guardar la configuración.</p>
    <button type="button" class="notice-dismiss">
        <span class="screen-reader-text">Descartar este aviso.</span>
    </button>
</d