Gitlab CI fix nvm install

deploy:staging:
  stage: deploy

  before_script:
    - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
    - export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion


deploy:staging:
  stage: deploy

  before_script:
    # Install node version spe
    - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bas

Building Custom-Domain Specific Tools

# Building Custom Domain-Specific Tools: A Step-by-Step Approach

Working closely with data governance and business teams is the key to success. 
Here's a structured approach to build these tools efficiently:

## 1. Knowledge Discovery & Pattern Identification

**Activities:**
- Review query logs to identify common search patterns and frequently accessed information
- Interview business users about their common information needs
- Document where specific business terms/concepts are sto

2145. Count the Hidden Sequences

You are given a 0-indexed array of n integers differences, which describes the differences between each pair of consecutive integers of a hidden sequence of length (n + 1). More formally, call the hidden sequence hidden, then we have that differences[i] = hidden[i + 1] - hidden[i]. You are further given two integers lower and upper that describe the inclusive range of values [lower, upper] that the hidden sequence can contain. For example, given differences = [1, -3, 4], lower = 1, upper = 6, the hidden sequence is a sequence of length 4 whose elements are in between 1 and 6 (inclusive). [3, 4, 1, 5] and [4, 5, 2, 6] are possible hidden sequences. [5, 6, 3, 7] is not possible since it contains an element greater than 6. [1, 2, 3, 4] is not possible since the differences are not correct. Return the number of possible hidden sequences there are. If there are no possible sequences, return 0.
/**
 * This function calculates the number of valid arrays that can be reconstructed
 * from a given list of differences within a specified range.
 *
 * @param {number[]} differences - An array of differences between consecutive elements.
 * @param {number} lower - The lower bound of the valid range.
 * @param {number} upper - The upper bound of the valid range.
 * @return {number} - The number of valid arrays that can be reconstructed.
 */
var numberOfArrays = function(differences, lower, upper

Main Domain and subdomain in same VPS setup


services:
  main-admin:
    build:
      args:
        user: admin
        uid: 1000
      context: ./jc
      dockerfile: Dockerfile
    container_name: main-admin
    restart: unless-stopped
    working_dir: /var/www/jc
    volumes:
      - ./jc:/var/www/jc
    networks:
      - main-net

  # Shared NGINX
  main-nginx:
    image: nginx:1.23-alpine
    container_name: main-nginx
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./jc:/var/www/jc
     

git rebase

# git rebase

git rebase 建议只对切出的父分支进行,例如 A checkout from B,则在 A 上只执行 git rebae B。这样能减少错误和冲突。

在执行 git rebase xxx 之后如果有冲突,手动解决之后,先执行 `git add .`,然后执行 `git rebase --continue`。这个过程中不会新增 commit。

**git rebase --continue 本质**:

1. 将你的分支上的 commits 暂时"搁置"
2. 将基础分支(你要 rebase 到的分支)的更改应用
3. 然后重新应用你的 commits

git rebase 之后,因为旧 commit 被修改,所以还要 `git push origin xxx --force-with-lease`。

**git push --force-with-lease**:
1. 这是一个"安全"的强制推送。
2. 在推送之前会检查远程分支的状态。
3. 只有当远程分支的状态与你最后一次从远程获取时的状态一致时,才会进行强制推送。
4. 如果其他人在你

drones_general_info

https://oscarliang.com/fpv-drone-guide/#How-Much-Does-an-FPV-Drone-Cost

781. Rabbits in Forest

There is a forest with an unknown number of rabbits. We asked n rabbits "How many rabbits have the same color as you?" and collected the answers in an integer array answers where answers[i] is the answer of the ith rabbit. Given the array answers, return the minimum number of rabbits that could be in the forest.
/**
 * @param {number[]} answers
 * @return {number}
 */
var numRabbits = function(answers) {
      // Step 1: Create a frequency map to count occurrences of each answer
    const countMap = {};
    for (const answer of answers) {
        countMap[answer] = (countMap[answer] || 0) + 1;
    }

    // Step 2: Initialize a variable to track the total number of rabbits
    let totalRabbits = 0;

    // Step 3: Iterate through each unique answer and its frequency in the map
    for (const [answer, fr

Commas with But and Because

**Exercise: Understanding Commas with "But" and "Because"**

In this exercise, you will read a text about the use of commas with the conjunctions "but" and "because." After reading the text, answer the questions based on what you've learned. Make sure to provide detailed answers to demonstrate your understanding.

**Text: Using Commas with "But" and "Because"**

Commas are essential in English punctuation, especially when using conjunctions like "but" and "because." Understanding when to u

Clean microSD

1. Встав microSD
2. Відкрий `CMD` від імені адміністратора (Win + S → Введи `cmd` → ПКМ → Запуск від імені адміністратора)
3. Введи команду:
```cmd
diskpart
```
4. Тепер у diskpart:
```cmd
list disk
```
5. Знайди номер microSD (напр. Disk 2, обережно — перевір розмір у ГБ!)
```cmd
select disk N
clean
convert mbr
create partition primary
format fs=fat32 quick
assign
exit
```
- clean — очищує всю інформацію про розділи / дані;
- convert mbr — встановлює MBR‑таблицю;
- create… і format… — створюють

Set Up

### Install
- Follow instructions [here](https://github.com/pret/pokeemerald/blob/master/INSTALL.md#instructions
)
- Make the first time takes long, but after if quick


### Emulator Keys
- Z BACK
- X OK
- Return brings up menu
- Arrows for movement

Subdomain redirect

In Registrar:
create a CNAME record for this subdomain

Type:  CNAME
Name:  buynow
Value: example.com (or wherever your NGINX is hosted)

Create the site nginx config, every new site needs this even if it hosts nothing
/etc/nginx/sites-available/buynow.example.com
server {
    listen 80;
    server_name buynow.example.com;

    return 301 https://buy.stripe.com/fZe9CvbK23df04EaEE;
}


Enable the config 
sudo ln -s /etc/nginx/sites-available/buynow.example.com /etc/nginx/sites-enabled/
Check and 

subdomain_re

_

38. Count and Say

The count-and-say sequence is a sequence of digit strings defined by the recursive formula: countAndSay(1) = "1" countAndSay(n) is the run-length encoding of countAndSay(n - 1). Run-length encoding (RLE) is a string compression method that works by replacing consecutive identical characters (repeated 2 or more times) with the concatenation of the character and the number marking the count of the characters (length of the run). For example, to compress the string "3322251" we replace "33" with "23", replace "222" with "32", replace "5" with "15" and replace "1" with "11". Thus the compressed string becomes "23321511". Given a positive integer n, return the nth element of the count-and-say sequence.
/**
 * Generates the nth element of the count-and-say sequence.
 *
 * @param {number} n - The position in the sequence (1-based index).
 * @return {string} - The nth element of the count-and-say sequence.
 */
var countAndSay = function(n) {
    // Validate the input: must be between 1 and 30 (inclusive)
    if (n < 1 || n > 30 || n == null) {
        return 'ERROR'; // Return an error if input is invalid
    }
    
    // Initialize the first sequence in the count-and-say sequence
    let previo

Get-GPOHavingSetting

function Get-GPOHavingSetting {
    [CmdLetBinding()]
    param (
        [System.String]$SettingName
    )

    Write-Host
    Write-Host "GPO Having Setting: " -NoNewline
    Write-Host $SettingName -ForegroundColor Green
    Write-Host

    #Get a list of GPOs from the domain
    $GPOs = Get-GPO -All | Sort-Object -Property DisplayName

    $Stopwatch = [Diagnostics.Stopwatch]::StartNew()
    $i = 0
    #Go through each Object and check its XML against $String
    try {
    

upload iOS app to appstore using github pipeline

You can use following 
https://www.andrewhoog.com/post/how-to-build-an-ios-app-with-github-actions-2023/

Embed pdf with cover or not

Ever wanted to embed PDFs so they can be viewed on the page? The first is kind of rubbish, but you need to see it, but the other 2 are awesome! Codes: Cover PDF = https://learn.websquadron.co.uk/codes/#cover-pdf Instant PDF = https://learn.websquadron.co.uk/codes/#embed-pdf https://www.youtube.com/watch?v=LPhzTTu8p_k
Cover pdf

<div id="pdf-container" style="width: 300px; height: 406px; overflow: hidden; position: relative;">
  <img decoding="async"
    id="pdf-preview"
    src="https://file.webp"
    alt="PDF Preview"
    style="width: 100%; height: 100%; object-fit: contain; cursor: pointer;"
    onclick="showPDF()"
  >
</div>


Embed pdf

<div style="width: 300px; height: 406px; overflow: hidden;">
  <iframe
    src="https://file.pdf#page=1&view=FitH"
    style="width: 100%; height: 100%