Js map array items

array.map((each) => console.log(each));

accordion shadow

.accordion-shadow {
  mask-image: linear-gradient(to bottom, black 30%, rgba(0,0,0,0.9) 70%, transparent 100%);
  mask-size: 100% 200%; // x luôn nhỏ hơn y
  mask-position: bottom;
  transition: -webkit-mask-position 1s ease, mask-position 1s ease;

  &.reveal {
    mask-position: top;
  }
}

2311. Longest Binary Subsequence Less Than or Equal to K

You are given a binary string s and a positive integer k. Return the length of the longest subsequence of s that makes up a binary number less than or equal to k. Note: The subsequence can contain leading zeroes. The empty string is considered to be equal to 0. A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.
/**
 * @param {string} s
 * @param {number} k
 * @return {number}
 */
var longestSubsequence = function(s, k) {
    // Special case: string is just "0"
    if (s === "0") return 1;

    // If the entire binary string is already less than or equal to k
    if (parseInt(s, 2) <= k) return s.length;

    // Convert k to binary string to determine its max length in bits
    let binaryK = k.toString(2);
    let res = 0;
    let i = 0;

    // Count how many leading '0's we can safely include before t

plotly - stacked 100 bar charts trend with bins

import pandas as pd
import plotly.graph_objects as go

# Your existing binning code
bins = list(range(0, 131, 10)) + list(range(130, 280, 30)) + [float('inf')]
labels_10s = [f'{i}-{i+9}' for i in range(0, 130, 10)]
labels_30s = [f'{i}-{i+29}' for i in range(130, 250, 30)]
labels_final = ['250+']
labels = labels_10s + labels_30s + labels_final

xml_samples['Bins'] = pd.cut(xml_samples['Days Since Last Crawled'],
                            bins=bins,
                            labels=labels,
   

Token for JWT / Bearer

<?php

$currentTime = time();
$timeWindow = 500; // token expiration
$expectedToken = hash_hmac('sha256', $currentTime - ($currentTime % $timeWindow), 'OUR_ANY_SECRET');

// echo hash_equals($expectedToken, $anyTokenFromGetorPost);

COMPLIANZE SHORT CODE

<strong>Elenco dei Cookie utilizzati</strong>

[cmplz-cookies]

<strong>Gestione Consenso</strong>

[cmplz-manage-consent]

List contents of Home directory on remote server

ssh -l <username> <FQDN of remote server> ls -al

CONTACT FORM

[acceptance acceptance-520] *Consenso Informativa <a href="/privacy-policy" target="_blank" title="Apre una nuova finestra per la consultazione della nostra Privacy Policy"> Privacy e Cookie Policy</a> [/acceptance]





-- 
Questa e-mail è stata inviata da:
Sito: [_site_title] 
URL: [_url] 
Dal numero IP: [_remote_ip]
Accettazione Privacy Policy: [acceptance-520]




Invoke-ExtractIcon

function Invoke-ExtractIcon {
    [CmdletBinding(SupportsShouldProcess)]
    Param(
        [Parameter(Position = 0, Mandatory,HelpMessage = "Specify the path to the file.")]
        [ValidateScript({Test-Path $_})]
        [string]$Path,

        [Parameter(HelpMessage = "Specify the folder to save the file.")]
        [ValidateScript({Test-Path $_})]
        [string]$Destination = ".",

        [parameter(HelpMessage = "Specify an alternate base name for the new image file. Otherwise, the sour

Flexera App Portal Web Extension IIS Log Analyzer

function Get-FlexeraAppPortalNameResolution {
    [CmdletBinding()]
    param(
        [System.IO.FileInfo[]]$Path
        ,
        [string]$ClientIP
    )

    function ConvertFrom-IISLog {
        [CmdletBinding()]
        param(
            [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
            [string]$Path
            ,
            [switch]$ShowFields
        )
        process {
            foreach ($Pat

TypeScript頻出パターン

// TypeScript型総復習

// 複数の基本的なプリミティブ型をまとめたUnion型
type Primitive = string | number | boolean | null | undefined | symbol | bigint;

// Animal型は3つのリテラル値のみを許すUnion型
type Animal = "cat" | "dog" | "bird";
// MaybeAnimal型はAnimal型またはnull/undefinedを許す
type MaybeAnimal = Animal | null | undefined;

// enum: 複数の決まった値の集合を表す。Color.Red などで使う
export enum Color {
  Red = "red",
  Blue = "blue",
  Green = "green",
}

// タプル型。配列だが要素ごとに型が違う。isCuteは省略可
type CatTuple = [name: string, age: number, isCute?: boolean];

.gitignore for Django project synced using GitHub in multiple devices (Win/Mac)

# === Sqlite databases  ===
#*.sqlite*

# === Virtual environments ===
.venv/
venv/
ENV/

# === Environment files ===
#.env
#*.env

# === IDE settings ===
#.idea/
#*.iml
# Ignore user-specific stuff
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/shelf
.idea/.name
# Keep project settings
!.idea/inspectionProfiles
!.idea/codeStyles
!.idea/misc.xml
!.idea/modules.xml
!.idea/encodings.xml
!.idea/vcs.xml
!*.iml # Keep module files ????

.vscode/

# === Python bytecode & logs ===
__pycac

UNIVERSES

items =  ['DBC', 'GLD', 'VTI', 'IEV', 'EWJ', 'EEM', 'ICF', 'RWX', 'IEF', 'TLT']

#11 asset universes
universes= [items]
for i in range(10):
    tmp = list(items)
#     print(tmp[i])
    del tmp[i]
#     print(tmp)
    universes = universes+[tmp]

universes

Função global para esconder mensagens de sucesso após 2 segundos

Função global para esconder mensagens de sucesso após 2 segundos
// Função global para esconder mensagens de sucesso após 2 segundos
function hideSuccessMessages() {
    setInterval(function() {
        var message = document.querySelector('.t-Alert--success');
        if (message) {
            message.style.display = 'none';
        }
    }, 2000);  // A mensagem desaparecerá após 3 segundos
}


hideSuccessMessages();

Refresh Região Close Dialog

Custom
dialogclose
Javascript Expression
document

Permanent alias

Make alias permanent by adding to .bashrc
sudo nano ~/.bashrc
alias string=‘command’