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 2      ← (підстав свій номер!)
clean
create partition primary
format fs=fat32 quick
assign
exit
```

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 

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%

Disable speculative loading in WP 6.8

 <?php
 add_filter( 'wp_speculative_loading_enabled', '__return_false' );
 ?>

Fetch image from instagram shortcode

/*-----------------------------------------------------------------------------------*/
/*
/*-----------------------------------------------------------------------------------*/
function getItems($config) {
    $limit = isset($config['limit']) ? (int)$config['limit'] : 10;

    $items = getCacheContents($config['instagramID'], $config['accessToken'], $limit);

    $output = '';

    foreach ($items as $index => $item) {
        if ($index >= $limit) break;

        $imgPath = isset($item->thumb

contact form 7 custom tag to get current site url

/* contact form 7 custom tag to get current site url
---------------------------------------------------------*/
function custom_site_url_form_tag_handler( $tag ) {
    $url = esc_url( home_url() );
    return $url;
}
add_action( 'wpcf7_init', function() {
    wpcf7_add_form_tag( 'site_url', 'custom_site_url_form_tag_handler', array( 'raw' ) );
});

2176. Count Equal and Divisible Pairs in an Array

Given a 0-indexed integer array nums of length n and an integer k, return the number of pairs (i, j) where 0 <= i < j < n, such that nums[i] == nums[j] and (i * j) is divisible by k.
/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var countPairs = function(nums, k) {
    // Initialize a counter to keep track of pairs that satisfy the conditions
    let count = 0;

    // Loop through all possible values of i (starting from index 0)
    for (let i = 0; i < nums.length; i++) {
        // For each i, loop through all possible values of j (starting from i + 1)
        for (let j = i + 1; j < nums.length; j++) {
            // Check if the values at ind

Parallax Background only when InView

Parallax the bg of an element ONLY when it enters the viewport (background-position-y: 0%) and leaves the viewport (background-position-y: 100%)
function isInViewport(element) {
    const rect = element.getBoundingClientRect();
    return rect.top < window.innerHeight && rect.bottom > 0;
 }

 function updateParallaxEffect(targetSelector) {
    const target = document.querySelector(targetSelector);
    if (!target) return;

    window.addEventListener('scroll', () => {
       const rect = target.getBoundingClientRect();
       const elementHeight = rect.height;
       const scrollTop = window.scrollY || window.pageYOffset;

Remove "Rendered with Bricks" from Admin Bar

<?php 
/* Remove "Rendered with Bricks" Admin Bar entry */
add_action('admin_bar_menu', 'remove_bricks_adminbar_item', 999);

function remove_bricks_adminbar_item($wp_admin_bar) {
    $wp_admin_bar->remove_node('editor_mode');
}
?>

Convert string from * to UTF-8

// Convert after read
$encoding = mb_detect_encoding( $content, array( 'UTF-8', 'ISO-8859-1', 'Windows-1252', 'ASCII' ), true );
if ( 'UTF-8' !== $encoding ) {
	$content = mb_convert_encoding( $content, 'UTF-8', $encoding ); // Convert from $encoding to UTF-8
}

// Convert before read
$handle = fopen( 'php://filter/read=convert.iconv.ISO-8859-1/UTF-8/resource=mon_fichier.csv', 'r' );