Snippets Collections
// where we have two arrays of checked and unchecked 

 function onHandleCheckbox(checkbox) {
        // create a new attay of objects with the value and checked status
        checkbox.addEventListener("change", () => {
            const status = [...trainingRadioBtns].map((btn) => ({
                value: btn.value,
                checked: btn.checked,
            }));
            // update global checkedValues array with objects of items that are checked then another with items unchecked
            checkedValues = status.filter((btn) => btn.checked).map((btn) => btn.value);
            notSelected = status.filter((btn) => !btn.checked).map((btn) => btn.value);
            // console.log("selected", checkedValues);
            // console.log("not selected", notSelected);

            // return values to the filteredItems array that match the below
            filteredItems = locations.filter((item) => {
                // Each individual match condition for filtering from the checkedvalues array or the notselected array
                const matchesFunded = (checkedValues.includes("governmentService") && item.governmentService) || notSelected.includes("governmentService");
                const matchesOnline = (checkedValues.includes("isAvailableOnline") && item.isAvailableOnline) || notSelected.includes("isAvailableOnline");
                const matchesPartTime = (checkedValues.includes("isAvailablePartTime") && item.isAvailablePartTime) || notSelected.includes("isAvailablePartTime");
                const matchesApprentice = (checkedValues.includes("apprenticeshipTraineeship") && item.apprenticeshipTraineeship) || notSelected.includes("apprenticeshipTraineeship");
                const matchesVetFeeCourse = (checkedValues.includes("isVetFeeCourse") && item.isVetFeeCourse) || notSelected.includes("isVetFeeCourse");

                // Check if the item matches All of the selected filters and return
                return matchesFunded && matchesOnline & matchesPartTime & matchesApprentice & matchesVetFeeCourse;
            });

            // updating functions
            noLocationsOverlay(filteredItems);

            checkLoadButton(filteredItems);

            displayLocations();

            updateMarkers(filteredItems);
        });
    }
#include<stdio.h>
// Author- Khadiza Sultana
// 10/8/2024
//Finding the largest number with the help of loop
int main()
{
    double number = 0, largest = 0; // initialization is done
    for(;;)
    {
        printf("Enter the number:");
        scanf("%lf", &number);
       
        if(number <= 0)
           break; // when zero or negative number then the infinite loop is broke

        if(number > largest)
           largest = number; // storing the largest number after comparing
    }
    printf("\nThe largest number is %g\n", largest);
   
    return 0;
}
$colors: (
  "primary": $primary,
  "secondary": $secondary,
  "error": $error,
  "info": $info,
  "blue": #1919e6,
  "red": #e61919,
  "yellow": #e6e619,
  "green": #19e635,
  "orange": #ffa600,
  "purple": #9900ff,
  "gray": #808080,
  "black": black,
  "white": white,
);



.card {
  display: block;
  padding: $base-padding;
  border: $base-border-thickness solid $light-grey;
  border-radius: $base-border-radius;
  box-shadow: $base-box-shadow;

  // Loop over all keys in the colors map and use them for background color variations
  @each $key, $val in $colors {
    &--bgcolor-#{$key} {
      background-color: $val;

        // Change text to white if the color is purple
    	// change the text to yellow if the color is red
    	// else leave it at black
      @if $key == "purple" {
        .card__body p {
          color: map-get($colors, "white" )
        }
      } @else if $key == "red"{
        .card__body p {
          color: map-get($colors, "yellow")
        }
      }@else {
        .card__body p {
          color: #000;
        }
      }
    }
  }

  &__title {
    h3 {
      font-size: $font-size-lg;
      padding-bottom: $base-padding;
      font-weight: bold;
    }
  }

  &__body {
    font-size: $base-font-size;

    a {
      text-decoration: underline;
    }
  }
}

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension