Snippets Collections
#include <iostream>
using namespace std;

int main(void){

}
FIRST IN THE PRODUCT PAGE ADD THE NEW BUTTON 
 <!---- // -------- NEW FAREHARBOR BLUE BUTTON -------- // ---->
      <div class="fhButton" style="margin-top: 1.5em !important;">
        <a href="<?php echo $fareHarborLink; ?>" style="font-weight: bold !important; width: 100% !important; font-family:Lato, sans-serif !important; font-size: 1em !important; box-shadow:none !important; padding: .15em 2em !important; border-radius: 3px !important;" class="fh-shape--square fh-size--small  fh-button-true-flat-blue fh-color--white">Book now</a>
      </div>


THEN IN THE THEME LIQUID FILE ADD THE SCRIPT
<!-------- // -------- FAREHARBOR SCRIPT TO OVERRIDE PREVIOUS SOFTWARE BLUE BUTTON - CREATED A NEW BLUE BUTTON -------- // -------->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
    $(document).ready(function() {
        // Object to map page slugs to FareHarbor links
        var pageToLinkMapping = {
            "knife-skills-vegetable-yaki-soba-vegan-5": "https://fareharbor.com/embeds/book/leedscookeryschool/items/580473/?full-items=yes&flow=1265884",
            "friday-night-takeaway-thai": "https://fareharbor.com/embeds/book/leedscookeryschool/items/580660/?full-items=yes&flow=1265866",
            "a-taste-of-mexico-3": "https://fareharbor.com/embeds/book/leedscookeryschool/items/580459/?full-items=yes&flow=1265859",
            "parent-and-kids-chinese-takeaway": "https://fareharbor.com/embeds/book/leedscookeryschool/items/580676/?full-items=yes&flow=1265838"
        };

        // Get the current page URL
        var currentUrl = window.location.pathname;
        
        // Extract the page slug (part after the last slash)
        var pageSlug = currentUrl.substring(currentUrl.lastIndexOf('/') + 1);

        // Default FareHarbor link (in case no match is found)
        var fareHarborLink = "https://fareharbor.com/embeds/book/leedscookeryschool/?full-items=yes";

        // Check if the page slug exists in the mapping
        if (pageToLinkMapping.hasOwnProperty(pageSlug)) {
            fareHarborLink = pageToLinkMapping[pageSlug];
        }

        // Update the href attribute of the booking button
        $('.fhButton a').attr('href', fareHarborLink);
    });
</script>
import axios from 'axios';
import { getItem } from '../../utility/localStorageControl';

const API_ENDPOINT = `${process.env.REACT_APP_API_ENDPOINT}/api`;

const authHeader = () => ({
  Authorization: `Bearer ${getItem('access_token')}`,
});

const client = axios.create({
  baseURL: API_ENDPOINT,
  headers: {
    Authorization: `Bearer ${getItem('access_token')}`,
    'Content-Type': 'application/json',
  },
});

class DataService {
  static get(path = '') {
    return client({
      method: 'GET',
      url: path,
      headers: { ...authHeader() },
    });
  }

  static post(path = '', data = {}, optionalHeader = {}) {
    return client({
      method: 'POST',
      url: path,
      data,
      headers: { ...authHeader(), ...optionalHeader },
    });
  }

  static patch(path = '', data = {}) {
    return client({
      method: 'PATCH',
      url: path,
      data: JSON.stringify(data),
      headers: { ...authHeader() },
    });
  }

  static put(path = '', data = {}) {
    return client({
      method: 'PUT',
      url: path,
      data: JSON.stringify(data),
      headers: { ...authHeader() },
    });
  }
}

/**
 * axios interceptors runs before and after a request, letting the developer modify req,req more
 * For more details on axios interceptor see https://github.com/axios/axios#interceptors
 */
client.interceptors.request.use((config) => {
  // do something before executing the request
  // For example tag along the bearer access token to request header or set a cookie
  const requestConfig = config;
  const { headers } = config;
  requestConfig.headers = { ...headers, Authorization: `Bearer ${getItem('access_token')}` };

  return requestConfig;
});

client.interceptors.response.use(
  (response) => response,
  (error) => {
    /**
     * Do something in case the response returns an error code [3**, 4**, 5**] etc
     * For example, on token expiration retrieve a new access token, retry a failed request etc
     */
    const { response } = error;
    const originalRequest = error.config;
    if (response) {
      if (response.status === 500) {
        // do something here
      } else {
        return originalRequest;
      }
    }
    return Promise.reject(error);
  },
);
export { DataService };
const scrollElm = document.scrollingElement;
scrollElm.scrollTop = 0;
if (document.prerendering) {
  document.addEventListener("prerenderingchange", initAnalytics, {
    once: true,
  });
} else {
  initAnalytics();
}
<style>
  html {
  font-family: avenir;
  margin: 2em;
  font-size: 180%;
  line-height: 1.5;
}

 
.navbar {
  display: flex;
  flex-wrap: wrap;
  width: max-content;
  gap: 1rem;
  border: 4px solid rebeccapurple;
  margin: 4em 0;
  padding: 0.25em 1em;
}
.navbar li {
  display: block; 
}
.navbar a {
  text-decoration: none;
  color: black;
}
.navbar a:hover {
  text-decoration: underline;
  text-decoration-color: orange;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.breadcrumbs {
  padding: 0;
  font-size: 84%;
}
.breadcrumbs li {
  display: inline-block; 
}
.breadcrumbs li::after {
  content: '>';
  font-size: 70%;
  padding: 0 0.5em;
  font-family: georgia, serif;
}
.breadcrumbs li:last-child::after {
  content:'';
}
.breadcrumbs a {
  color: black;
  text-underline-offset: 3px;
}
.breadcrumbs a:hover {
  text-decoration: underline;
  text-decoration-color: yellow;
  text-decoration-thickness: 1.1em;
  text-underline-offset: -0.9em;
  text-decoration-skip-ink: none;
}

</style>
<nav role="breadcrumb">
  <ol class="breadcrumbs">
    <li><a href="/">Home</a></li>
    <li><a href="/people">Blog</a></li>
    <li><a href="/contact">March</a></li>
    <li>March 9th Update</li>
  </ol>
</nav>

<main>
  <style>
    body {
  font-family: Avenir, Helevetica, sans-serif;
  margin: 1rlh 2rlh;
  font-size:0.9rem;
}
details {
  border: 1px solid grey;
  margin-block: 1rlh;
  padding: 1rlh;
  margin-trim: block;
}
details[open] summary {
  margin-block-end: 0.5rlh;
  color: red;
}
h1 {
  font-size: 1.1rem;
  font-weight: 400;
}
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rlh;
}
code {
  background: #eee;
  padding: 0.2rlh;
  border-radius: 0.2rlh;
}
  </style>

  <section>
    <h1>Without name attributes</h1>
    <details open>
      <summary>Item 1</summary>
      <p>This is a <code>details</code> element, with a summary inside. It has an <code>open</code> attribute. This causes it to be open by default when the page loads, instead of closed.</p>
    </details>
    <details >
      <summary>Item 2</summary>
      <p>This is just like “Item 1” above, except without the <code>open</code> attribute.</p>
    </details>
    <details>
      <summary>Item 3</summary>
      <p>This is a third item.</p>
    </details>
  </section>
  
  <section>
      <button data-action="open">open all</button>
    <h1>With name attributes on each detail</h1>
    <details name="foobar" open>
      <summary>Item 1</summary>
      <p>In this column, all three items are named with the same name, using the <code>name</code> attribute. Which means any time a user clicks to open one item, any open item will automatically close.</p> 
      <p>Also, here the first item has the <code>open</code> attribute applied, so it’s open by default.</p> 
    </details>
    <details name="foobar">
      <summary>Item 2</summary>
      <p>Notice when you clicked this item, any open item automatically closed.</p>
    </details>
    <details name="foobar">
      <summary>Item 3</summary>
      <p>Using the <code>name</code> attribute can make for a better user experience. Users don’t have to manually manage a lot of open items. And developers don’t have to write any JavaScript to get this affect. The browser does the work.</p>
      <p>Take care, however, to make sure this is the best experience given your usecase. Think about users who might want or need to compare one item to another.</p>
    </details>
  </section>
</main>
<style>
  *{box-sizing: border-box;}

body {margin:0; background-color:#eee;
  font-family: 'Open Sans', sans-serif;
  font-size: 80%;
}

h1, p {margin: 1em 20px 0;}

.wrapper {
  display: flex; 
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-start;
}

article {
  flex: 1 1 200px;
  min-width: 200px; 
  max-width: 400px;
  border: 1px solid #000;
  padding-bottom: 20px;
}

img {
  width: 100%;
}

.dark-pattern {
  visibility: hidden;
  margin-top: 0;
  margin-bottom: 0;
  padding-top:0;
  padding-bottom: 0;
  border-width-top: 0;
  border-bottom: 0;
}
</style>
<main class="wrapper">
  <article>
    <img src="http://labs.thewebahead.net/images/zeldman2.jpg"><h1>Headline</h1><p>All of these beautiful NYC by photos are <a href="https://www.flickr.com/photos/zeldman">Jeffrey Zeldman</a>.</p>
  </article>

  <article><img src="http://labs.thewebahead.net/images/zeldman1.jpg">
  <h1>At vero eros et accumsan</h1><p>Et iusto odio dignissim qui blandit praesent. Nulla non ipsum condimentum, iaculis tellus et, tristique magna.</p></article>
 
  <article>
  <img src="http://labs.thewebahead.net/images/zeldman5.jpg">
  <p>Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. Souvlaki ignitus carborundum e pluribus unum.</p></article>
  
  <article>
  <img src="http://labs.thewebahead.net/images/zeldman6.jpg">
  <h1>Luptatum zzril delenit augue</h1><p>Duis dolore te feugait nulla facilisi.</p></article>

  <article><img src="http://labs.thewebahead.net/images/zeldman7.jpg"></article>

  <article><img src="http://labs.thewebahead.net/images/zeldman10.jpg">
  <h1> Duis commodo ex quam</h1>
  <p>Et molestie sapien viverra eu. Vestibulum commodo elit maximus dui egestas lobortis. Nullam fringilla ultricies nulla nec dictum. Suspendisse potenti. Maecenas blandit sollicitudin est, vitae finibus ex dictum id.</p></article>

  <article><img src="http://labs.thewebahead.net/images/zeldman11.jpg">
    <h1>Aenean</h1>
    <p>Mauris magna elit, finibus id accumsan et, eleifend vitae velit. Ut egestas, ante eu iaculis mollis, ipsum est fermentum libero, eu dignissim mauris est sit amet nulla.</p></article>  
  

  <article class="dark-pattern"></article>
  <article class="dark-pattern"></article>
  <article class="dark-pattern"></article>
  <article class="dark-pattern"></article>
  <article class="dark-pattern"></article>
  <article class="dark-pattern"></article>
  <article class="dark-pattern"></article>
  <article class="dark-pattern"></article>
</main>
<h1>Accessible toggle checkbox</h1>
<br>
<style>
  .toggle {
  position: relative;
}
.toggle *,
.toggle *:before,
.toggle *:after {
  box-sizing: border-box;
}
.toggle input[type=checkbox] {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  padding: 0;
}
.toggle input[type=checkbox]:focus ~ label .toggle__switch, .toggle input[type=checkbox]:hover ~ label .toggle__switch {
  background-color: #444;
}
.toggle input[type=checkbox]:checked:focus ~ label .toggle__switch, .toggle input[type=checkbox]:checked:hover ~ label .toggle__switch {
  background-color: #34690c;
}
.toggle input[type=checkbox]:checked ~ label .toggle__switch {
  background-color: #529c1a;
}
.toggle input[type=checkbox]:checked ~ label .toggle__switch:before {
  content: attr(data-unchecked);
  left: 0;
}
.toggle input[type=checkbox]:checked ~ label .toggle__switch:after {
  transform: translate3d(28px, 0, 0);
  color: #34690c;
  content: attr(data-checked);
}
.toggle label {
  user-select: none;
  position: relative;
  display: flex;
  align-items: center;
}
.toggle label .toggle__label-text {
  font-size: 1rem;
  padding-right: 30px;
}
.toggle .toggle__switch {
  font-size: 10px;
  height: 30px;
  -webkit-box-flex: 0;
  flex: 0 0 60px;
  border-radius: 30px;
  transition: background-color 0.3s cubic-bezier(0.86, 0, 0.07, 1);
  background: #636060;
  position: relative;
}
.toggle .toggle__switch:before {
  left: 30px;
  font-size: 10px;
  line-height: 30px;
  width: 30px;
  padding: 0 4px;
  color: #e6e6e6;
  content: attr(data-checked);
  position: absolute;
  top: 0;
  text-transform: uppercase;
  text-align: center;
}
.toggle .toggle__switch:after {
  font-weight: 700;
  top: 2px;
  left: 2px;
  border-radius: 15px;
  width: 28px;
  line-height: 26px;
  font-size: 10px;
  transition: transform 0.3s cubic-bezier(0.86, 0, 0.07, 1);
  color: #34690c;
  content: attr(data-unchecked);
  position: absolute;
  z-index: 5;
  text-transform: uppercase;
  text-align: center;
  background: white;
  transform: translate3d(0, 0, 0);
}
</style>
<div class="toggle">
  <input id="toggle-demo" type="checkbox">
  <label for="toggle-demo">
    <div class="toggle__label-text">Toggle Me</div>
    <div class="toggle__switch" data-checked="Yes" data-unchecked="No"></div>    
  </label>
</div>
body:has(input[type="checkbox"]:checked) {
  background: blue;
  --primary-color: white;
}
body:has(input[type="checkbox"]:checked) form { 
  border: 4px solid white;
}
body:has(input[type="checkbox"]:checked) form:has(:focus-visible) {
  background: navy;
}
body:has(input[type="checkbox"]:checked) input:focus-visible {
  outline: 4px solid lightsalmon;
}
body:has(option[value="pony"]:checked) {
  --font-family: cursive;
  --text-color: #b10267;
  --body-background: #ee458e;
  --main-background: #f4b6d2;
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":magic_wand::xero-unicorn: End of Year Celebration – A Sprinkle of Magic! :xero-unicorn: :magic_wand:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Hey Wellington!* \nGet ready to wrap up the year with a sprinkle of magic and a lot of fun at our End of Year Event! Here’s everything you need to know:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"fields": [
				{
					"type": "mrkdwn",
					"text": "*:calendar-date-22: When:*\nFriday 22nd, November"
				},
				{
					"type": "mrkdwn",
					"text": "*📍 Where:*\n<https://maps.app.goo.gl/GLoBA1qohkzKJ6La9|*Shed 6*> \n12 Queens Wharf, Wellington Central"
				},
				{
					"type": "mrkdwn",
					"text": "*⏰ Time:*\n4:00 pm - 10:00 pm"
				}
			]
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*:magic_wand::xero-unicorn: Theme:*\n_A Sprinkle of Magic_ – Our theme is inspired by the Xero Unicorn, embracing creativity, inclusivity, and diversity. Expect unique decor, magical moments, and a fun-filled atmosphere!"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*:dress: Dress Code:*\n*Smart casual* – Show your personality, but no Xero tees or lanyards, please! \n\nIf you're feeling inspired by the theme, why not add a little 'Sprinkle of Magic' to your outfit? Think glitter, sparkles, or anything that shows off your creative side! (Totally optional, of course! ✨)"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🚍 Transport Info:*\n*Parking:* A 3 minute drive from the office, with Wilson Parking - Queens Wharf open 24 hours \n*Along the waterfront:* An 11 minute walk from Xero along the waterfront"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎤 :hamburger: Entertainment & Food:*\nPrepare to be dazzled by live music, cozy chill-out zones, delicious bites, refreshing drinks, and plenty of surprises! "
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎟 RSVP Now:* Click <https://xero-wx.jomablue.com/reg/store/eoy_wlg|here> to RSVP! \nMake sure you RSVP by *_Friday, 8th November 2024_*"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":question:Got questions? See the <https://docs.google.com/document/d/1iygJFHgLBRSdAffNsg3PudZCA45w6Wit7xsFxNc_wKM/edit|FAQs> doc or post in the Slack channel.\n\nWe can’t wait to celebrate with you! :partying_face: :xero-love:"
			}
		}
	]
}
public static void main(Args _args)
    {
        #DMF
        Query						  query;
        DMFEntityName				  entityName = "Inventory movement journal headers and lines";
        SharedServiceUnitFileID		  fileId;
        List						  xsltFileList = new List(Types::String);
        boolean						  isGenerated = false;
        VLSAzureSMBFileStorageHandler azureFileStorageProcessor;
        CustParameters				  custParameters = CustParameters::find();
        
        // Update query
        query = new query(dmfutil::getdefaultqueryforentity(entityname));
        querybuilddatasource qbds = query.datasourcetable(tableNum(InventInventoryMovementJournalEntryEntity));

        // Export file
		// Definition group will be created if it is not existed
        DMFDefinitionGroupName definitionGroupName = 'Invent journal entity';

        try
        {
            DMFEntityExporter exporter = new DMFEntityExporter();

            //There are optional parameters also added
            fileId = exporter.exportToFile(
            entityName,//Entity label
            definitionGroupName,//Definition group to reuse
            '',//ExecutionId group to reuse,
            'CSV',//Source format to export in
            'VLSInventJournal',//Specify the field group fields to include in export.
            query.pack(),//Query criteria to export records
            curExt(),//Default curExt()
            null,//List of XSLT files
            true,//showErrorMessages
            false);//showSuccessMessages

            if (fileId != '')
            {
                //Get Azure blob url from guid
                str downloadUrl = DMFDataPopulation::getAzureBlobReadUrl(str2Guid(fileId));

                System.Uri uri = new System.Uri(downloadUrl);
                str fileExt;
                //Get file extension
                if (uri != null)
                {
                    fileExt = System.IO.Path::GetExtension(uri.LocalPath);
                }

                Filename filename = strFmt('InventJournal%1',fileExt);
                System.IO.Stream stream = File::UseFileFromURL(downloadUrl);
                //Send the file to user
                //File::SendFileToUser(stream, filename);

                DMFDefinitionGroup::find(definitionGroupName, true).delete();

                isGenerated = true;

                azureFileStorageProcessor   = new VLSAzureSMBFileStorageHandler();
                azureFileStorageProcessor.parmAccountName(custParameters.VLSOutboundAccountName);
                azureFileStorageProcessor.parmAccountKey(custParameters.VLSOutboundAccessKey);
                azureFileStorageProcessor.parmFileShareName(custParameters.VLSOutboundFileShareName);
                azureFileStorageProcessor.parmDestinationFileShareName(custParameters.VLSOutboundFileShareName);
                azureFileStorageProcessor.parmErrorFileShareName(custParameters.VLSOutboundFileShareName);
                azureFileStorageProcessor.openConnection();
                azureFileStorageProcessor.resetToRootDirectory();
                azureFileStorageProcessor.setDirectory(custParameters.VLSOutboundInProcess);

                azureFileStorageProcessor.uploadFromStream(stream, filename);
                info(strFmt("File %1 has been moved to Azure storage folder", filename));
			 }
            else
            {
                throw error("The file was not generated succefully.");
            }
        }
        catch
        {
            
            throw error("Data export execution failed.");
        }
    }
 #DMF
        SharedServiceUnitFileID fileId;
        DMFDefinitionGroupName definitionGroupName = "MyUniqueDefinitionGroupName";

        try
        {
            str x = "#FieldGroupName_AllFields";


            EntityName      entityName;
            DMFEntity       dmfEntity;


            select firstonly dmfEntity  order by EntityName asc where dmfEntity.TargetEntity == dataEntityViewStr(SalesOrderV3Entity);

            entityName = dmfEntity.EntityName;

            Query                query = new Query(DMFUtil::getDefaultQueryForEntity(entityName, "ExportTest"));

            DMFEntityExporter exporter = new DMFEntityExporter();
            fileId = exporter.exportToFile(entityName,
                                definitionGroupName,
                                '', //Optional: ExecutionID
                                "XML-Attribute", //Optional::SourceName
                                x, //Optional field selection
                                query.pack(), //Optional: Filtered Query
                                curExt() //Optional: DataAReaId
                                );


            if (fileId != '')
            {
                str downloadUrl = DMFDataPopulation::getAzureBlobReadUrl(str2Guid(fileId));

                System.Uri uri = new System.Uri(downloadUrl);
                str fileExt;

                if (uri != null)
                {
                    fileExt = System.IO.Path::GetExtension(uri.LocalPath);
                }
                
                Filename filename = strFmt('MyFirstExport%1',fileExt);
                System.IO.Stream stream = File::UseFileFromURL(downloadUrl);
                File::SendFileToUser(stream, filename);

            }
            else
            {
                throw error("DMF execution failed and details were written to the execution log");
            }
        }
        catch
        {
            error("error occurred while exporting");
        }
[
  {
    $project: {
      _id: 1,
      followUps: 1,
      duplicateNames: {
        $filter: {
          input: {
            $map: {
              input: "$followUps",
              as: "f",
              in: "$$f.name"
            }
          },
          as: "name",
          cond: {
            $and: [
              { $ne: ["$$name", "Check_in"] }, 
              {
                $gt: [
                  { $size: {
                      $filter: {
                        input: {
                          $filter: {
                            input: "$followUps",
                            as: "innerF",
                            cond: { $eq: ["$$innerF.name", "$$name"] }
                          }
                        },
                        as: "duplicate",
                        cond: { $eq: ["$$duplicate.name", "$$name"] }
                      }
                    }
                  },
                  1
                ]
              }
            ]
          }
        }
      }
    }
  },
  {
    $match: {
      $expr: { $gt: [{ $size: "$duplicateNames" }, 0] }
    }
  },
  {
    $project: {
      _id: 1
    }
  }
]
Are you ready to take your business into the future of finance? At Maticz, we specialize in revolutionary crypto development services designed to power up your business in the digital age. Whether you are seeking to embark your own crypto exchange, develop a custom blockchain, or create the next big thing in decentralized finance (DeFi) we have got you covered.

Why Choose Maticz?

Proven Expertise: With years of experience and track record of success, Maticz is trusted by businesses worldwide to deliver innovative crypto solutions.

Tailored Solutions: Our development services are designed to meet the specific needs of your business, ensuring seamless integration and long-term scalability.

Security First: We prioritize security at every step, protecting your platform and users with the latest in blockchain technology.

Cutting-Edge Technology: From NFT marketplaces to decentralized exchanges (DEXs) and tokenization platforms, we’re constantly innovating to stay ahead of the curve.

For Entrepreneurs and Enterprises Alike
Whether you're an entrepreneur looking to disrupt the market or an established business ready to adopt blockchain technology, Maticz offers end-to-end cryptocurrency development solutions tailored to your needs.

Your Vision, Our Expertise

Ready to launch your crypto project? Partner with Maticz, the cryptocurrency development company that’s powering the digital transformation of businesses across the globe.

Get a free live demo along with video guidelines and price plan,

Email: sales@maticz.com
Whatsapp: +91 93845 87998
Telegram: @maticzofficial
Skype: live:.cid.817b888c8d30b212
 
import pygame
import random
import time
speed = 15
x = 720
y = 480
black = pygame.Color(0, 0, 0)
white = pygame.Color(255, 255, 255)
red = pygame.Color(255, 0, 0)
green = pygame.Color(0, 255, 0)
blue = pygame.Color(0, 0, 255)
pygame.init()
(5, 0)
window = pygame.display.set_mode((x, y))
fps = pygame.time.Clock()
sp = [100, 50]
sb = [[100,50],
      [90, 50],
      [80, 50],
     [70, 50]]
fp = [random.randrange(1, (x//10)) * 10,
      random.randrange(1, (y//10)) * 10]
fruit_spawn = True
dr = 'RIGHT'
change_to = dr
while True:
    for event in pygame.event.get():
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_UP:
                sp[1] -= 10
            if event.key == pygame.K_DOWN:
                sp[1] += 10
            if event.key == pygame.K_LEFT:
                sp[0] -= 10
            if event.key == pygame.K_RIGHT:
                sp[0] += 10

                
#growth happens if tail not removed and fruit is eaten 
sb.insert(0, list(sp))
if sp[0] == fp[0] and sp[1] == fp[1]:
fruit_spawn = False
#tail constantly removed and no growth if fruit not eaten
else:
snake_body.pop()
if not fruit_spawn:
fp = [random.randrange(1,(x//10)) * 10, random.randrange(1,(y//10)) * 10]
fruit_spawn = True
window.fill(black)
for pos in sb:
pygame.draw.rect(window, green,
pygame.Rect(pos[0], pos[1], 10, 10))
pygame.draw.rect(window, white, pygame.Rect(fruit_position[0], fruit_position[1], 10, 10))
pygame.display.update()
fps.tick(snake_speed)
struct node {
    node* arr[26] = {nullptr};
    bool flag = false;
    vector<string> below;
    bool contains(char ch) {
        if (arr[ch - 'a']) return true;
        else return false;
    }
    void add(char ch, node* sub) {
        arr[ch - 'a'] = sub;
    }
    node* next(char ch) {
        return arr[ch - 'a'];
    }
    void end() {
        flag = true;
    }
    bool isend() {
        return flag;
    }
    void ins(string bel) {
        below.push_back(bel);
    }
    void put(vector<string>& res) {
        int count = 0;
        for (auto it : below) {
            res.push_back(it);
            if (++count == 3) break;
        }
    }
};

class Trie {
private:
    node* root = new node();
public:
    void insert(string word) {
        node* nod = root;
        for (int i = 0; i < word.length(); ++i) {
            if (!nod->contains(word[i])) {
                nod->add(word[i], new node()); 
            }
            nod = nod->next(word[i]);
            nod->ins(word);
        }
        nod->end();
    }

    vector<vector<string>> search(string word) {
        vector<vector<string>> res;
        node* nod = root;
        for (int i = 0; i < word.length(); ++i) {
            vector<string> ans;
            if (!nod->contains(word[i])) {
                break;
            }
            nod = nod->next(word[i]);
            nod->put(ans);
            res.push_back(ans);
        }
        while (res.size() < word.size()) {
            res.push_back({});
        }
        return res;
    }
};

class Solution {
public:
    vector<vector<string>> suggestedProducts(vector<string>& products, string searchWord) {
        sort(products.begin(), products.end());
        Trie a;
        for (auto it : products) {
            a.insert(it);
        }
        return a.search(searchWord);
    }
};
function lazyLoad() {
  const images = document.querySelectorAll('img[data-src]');
  const iframes = document.querySelectorAll('iframe[data-src]');
  const elements = [...images, ...iframes]; 

  const observer = new IntersectionObserver(entries => {
    entries.forEach(entry => {
      if (entry.isIntersecting) {
        const element = entry.target;
        if (element.tagName === 'IMG') {
          element.src = element.dataset.src;
        } else if (element.tagName === 'IFRAME') {
          element.src = element.dataset.src;
        }
        observer.unobserve(element);
      }
    });
  });

  elements.forEach(element => observer.observe(element));
}

document.addEventListener('DOMContentLoaded', lazyLoad);
import java.awt.*;
import java.awt.event.*;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;

// Main application class
class MiniGameApp {
    public static void main(String[] args) {
        // Start with Whack-A-Mole
        new WhackAMole();
    }
}

// Whack-A-Mole Game Class
class WhackAMole extends Frame implements ActionListener {
    private Button[] buttons = new Button[9];
    private int moleIndex = -1;
    private Random random = new Random();
    private Timer timer;
    private int score = 0;
    private Label scoreLabel;

    public WhackAMole() {
        // Frame setup
        setTitle("Whack-A-Mole");
        setSize(500, 500);
        setLayout(new GridLayout(4, 3));
        setBackground(new Color(255, 228, 196)); // Light peach background

        // Initialize buttons
        for (int i = 0; i < buttons.length; i++) {
            buttons[i] = new Button("");
            buttons[i].setBackground(new Color(211, 211, 211)); // Light gray
            buttons[i].setFont(new Font("Arial", Font.BOLD, 16));
            buttons[i].addActionListener(this);
            add(buttons[i]);
        }

        scoreLabel = new Label("Score: 0", Label.CENTER);
        scoreLabel.setFont(new Font("Arial", Font.BOLD, 18));
        scoreLabel.setBackground(new Color(255, 255, 224)); // Light yellow
        scoreLabel.setForeground(Color.BLUE); // Blue text
        add(scoreLabel);

        // Timer to spawn mole every second
        timer = new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                spawnMole();
            }
        }, 0, 1000);

        // Button to switch to Rock-Paper-Scissors
        Button switchGameBtn = new Button("Switch to Rock-Paper-Scissors");
        switchGameBtn.setBackground(new Color(100, 149, 237)); // Cornflower blue
        switchGameBtn.setForeground(Color.WHITE); // White text
        switchGameBtn.setFont(new Font("Arial", Font.BOLD, 16));
        switchGameBtn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose(); // Close the current game frame
                new RockPaperScissors(); // Open the Rock-Paper-Scissors game
            }
        });
        add(switchGameBtn);

        setVisible(true);
    }

    private void spawnMole() {
        // Reset previous mole
        if (moleIndex != -1) {
            buttons[moleIndex].setBackground(new Color(211, 211, 211)); // Light gray
            buttons[moleIndex].setLabel("");
        }

        // Spawn new mole at random index
        moleIndex = random.nextInt(buttons.length);
        buttons[moleIndex].setBackground(Color.GREEN); // Green for mole
        buttons[moleIndex].setLabel("Mole!");
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Button clickedButton = (Button) e.getSource();
        // Check if the clicked button is the mole
        if (clickedButton == buttons[moleIndex]) {
            score++;
            scoreLabel.setText("Score: " + score);
            clickedButton.setBackground(new Color(211, 211, 211)); // Reset to light gray
            clickedButton.setLabel("");
        }
    }
}

// Rock-Paper-Scissors Game Class
class RockPaperScissors extends Frame implements MouseListener {
    Image rockImg, paperImg, scissorImg;
    Canvas rockCanvas, paperCanvas, scissorCanvas;
    TextField userChoiceField, computerChoiceField, resultField;
    String userChoice, computerChoice;
    Random random;

    RockPaperScissors() {
        random = new Random();
        setSize(600, 600);
        setTitle("Rock Paper Scissors Game");
        setLayout(new BorderLayout());
        setBackground(new Color(135, 206, 250)); // Sky blue background

        // Create a panel for the images
        Panel imagePanel = new Panel();
        imagePanel.setLayout(new GridLayout(1, 3));

        rockCanvas = createCanvas("rock.png");
        paperCanvas = createCanvas("paper.png");
        scissorCanvas = createCanvas("scissors.png");

        imagePanel.add(rockCanvas);
        imagePanel.add(paperCanvas);
        imagePanel.add(scissorCanvas);

        // Create a panel for user choice, computer choice, and result
        Panel infoPanel = new Panel();
        infoPanel.setLayout(new GridLayout(4, 1));

        userChoiceField = new TextField("Your Choice: ");
        userChoiceField.setEditable(false); // Make it read-only
        computerChoiceField = new TextField("Computer's Choice: ");
        computerChoiceField.setEditable(false); // Make it read-only
        resultField = new TextField("Result: ");
        resultField.setEditable(false); // Make it read-only

        infoPanel.add(userChoiceField);
        infoPanel.add(computerChoiceField);
        infoPanel.add(resultField);

        // Button to switch back to Whack-A-Mole
        Button switchGameBtn = new Button("Switch to Whack-A-Mole");
        switchGameBtn.setBackground(new Color(255, 99, 71)); // Tomato color
        switchGameBtn.setForeground(Color.WHITE); // White text
        switchGameBtn.setFont(new Font("Arial", Font.BOLD, 16));
        switchGameBtn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose(); // Close the current game frame
                new WhackAMole(); // Open the Whack-A-Mole game
            }
        });
        infoPanel.add(switchGameBtn);

        // Add panels to the frame
        add(imagePanel, BorderLayout.CENTER);
        add(infoPanel, BorderLayout.SOUTH);

        setVisible(true);
    }

    private Canvas createCanvas(String imgPath) {
        Canvas canvas = new Canvas() {
            public void paint(Graphics g) {
                Image img = Toolkit.getDefaultToolkit().getImage(imgPath);
                g.drawImage(img, 0, 0, 100, 100, this);
            }
        };
        canvas.setSize(100, 100);
        canvas.addMouseListener(this);
        return canvas;
    }

    public void mouseClicked(MouseEvent e) {
        // Determine user choice based on the clicked canvas
        if (e.getSource() == rockCanvas) {
            userChoice = "rock";
        } else if (e.getSource() == paperCanvas) {
            userChoice = "paper";
        } else if (e.getSource() == scissorCanvas) {
            userChoice = "scissor";
        }

        // Update user choice field
        userChoiceField.setText("Your Choice: " + userChoice);
        
        // Set computer choice only after user choice is made
        setComputerChoice();

        // Determine the result based on user and computer choices
        String result = determineWinner(userChoice, computerChoice);
        resultField.setText("Result: " + result);
        computerChoiceField.setText("Computer's Choice: " + computerChoice);
    }

    private void setComputerChoice() {
        int b = random.nextInt(3);
        if (b == 0) computerChoice = "rock";
        else if (b == 1) computerChoice = "paper";
        else computerChoice = "scissor";
    }

    public String determineWinner(String userChoice, String computerChoice) {
        if (userChoice.equals(computerChoice)) return "It's a tie!";
        if (userChoice.equals("rock")) return computerChoice.equals("scissor") ? "You win!" : "You lose!";
        if (userChoice.equals("paper")) return computerChoice.equals("rock") ? "You win!" : "You lose!";
        return computerChoice.equals("paper") ? "You win!" : "You lose!";
    }

    public void mouseEntered(MouseEvent e) {}
    public void mouseExited(MouseEvent e) {}
    public void mousePressed(MouseEvent e) {}
    public void mouseReleased(MouseEvent e) {}
}
# run the command:
RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll

# Select the device in the Safely Remove Hardware dialog and click Stop. The device can then be safely unplugged.
⚡️ Awesome LWC Collection
   

About the project
The repository should provide a collection of ready-to-use Lightning Web Components that might help your SFDX project and is intended to grow over time. Additionally, it also includes an initial configuration of Prettier, linting rules, git hooks and unit tests as well as useful VS Code settings. The setup really focuses on LWC development.

Components available
The following list of components is part of this repo. All components contain corresponding unit tests and docs.

Base64 To PDF
Content Document Table
CSV To Datatable
Custom Datatable
Custom Map View
Custom Slider
Drag & Drop Example
Hello World
iFrame
Local Development Wrapper
Multi Select Combobox
Open Record Page Flow Action
Render 3D Elements (Three.js)
Take User Profile Picture (Webcam)
Visualforce To PDF
# Run these two commands from an elevated command prompt:
MD C:\Drivers_Backup
pnputil /export-driver * C:\Drivers_Backup
<a class="slds-button slds-button_brand" href="{!RecordLink}" target="_self">Finish</a>
#include <iostream>
using namespace std;

// Function to sort the array using insertion sort algorithm.
void processSelectionSort(int arr[], int n) {
  
  for (int i = 0 ;i<n;i++){
    int minIndex=i;
     for (int j = i ;j<n;j++){
        if(arr[j]<arr[minIndex]){
           minIndex = j;
        }
    }
    std::swap(arr[i],arr[minIndex]);
  }
}

void displayArray(int arr[], int n) {
  for (int i = 0; i < n; i++) {
    cout << arr[i] << " ";
  }
  cout << endl;
}

// Function to dynamically allocate an array and fill it with random values.
void fillDynamicArrayWithRandomValues(int** arr, int* n) {
    cout << "Enter the size of the array: ";
    cin >> *n;
    *arr = new int[*n];
    srand(time(0)); // Seed for random number generation
    for (int i = 0; i < *n; i++) {
        (*arr)[i] = rand() % 1000; // Fill with random numbers between 0 and 999
    }
}

int main() {
    int* arr;
    int n;
    fillDynamicArrayWithRandomValues(&arr, &n);
    cout << "Unsorted array: ";
    displayArray(arr, n);
    processSelectionSort(arr, n);
    cout << "Sorted array: ";
    displayArray(arr, n);
    delete[] arr; // Deallocate dynamically allocated memory
    return 0;
}
<style>
  .noto--exploding-head::after {

  display: inline-block;

  width: 5em;

  height: 5em;

  vertical-align: -0.125em;

  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E%3Cdefs%3E%3Cpath id='notoExplodingHead0' fill='%2333a3c3' d='M119.45 65.8c-1.27 14.33-7.2 26.51-17.34 35.5c-10.6 9.3-25 14.5-40.4 14.5c-17.97 0-36.84-7.28-48-22.71c.1.17.2.34.31.5c.35.55.7 1.08 1.07 1.61c.27.39.53.78.81 1.16q.885 1.2 1.83 2.34c.3.36.61.7.91 1.05c.43.49.87.97 1.31 1.44a46 46 0 0 0 2.92 2.84c.33.3.67.58 1 .87c.57.48 1.14.95 1.72 1.41c.34.27.69.53 1.04.79c.59.44 1.2.86 1.81 1.28c.28.19.56.39.84.58c.85.55 1.71 1.08 2.59 1.58c.33.19.67.37 1 .55c.65.36 1.31.7 1.97 1.04c.32.16.65.33.97.48c.93.45 1.87.87 2.83 1.27c.25.1.5.19.74.29c.77.31 1.55.6 2.34.88c.33.12.67.23 1 .35c.87.29 1.75.57 2.63.82c.16.05.32.1.47.14c1.03.29 2.06.54 3.1.78c.31.07.61.13.92.2c.83.18 1.66.33 2.49.48c.27.05.53.1.79.14c1.06.17 2.12.31 3.18.43c.23.03.46.04.68.07q1.305.135 2.61.21c.3.02.6.04.89.05c1.07.05 2.15.09 3.22.09c15.4 0 29.8-5.2 40.4-14.5c.7-.62 1.38-1.26 2.03-1.9c.22-.22.44-.45.66-.68c.42-.43.85-.87 1.26-1.31c.26-.28.5-.57.75-.86c.35-.4.7-.8 1.04-1.22c.26-.32.51-.65.76-.97c.31-.39.61-.78.91-1.19c.25-.35.5-.71.74-1.06c.27-.39.54-.78.8-1.18c.24-.38.48-.76.71-1.14c.24-.39.48-.78.71-1.18s.45-.81.67-1.21c.21-.39.42-.78.62-1.18c.22-.42.42-.85.63-1.29c.18-.39.36-.78.54-1.18c.2-.45.39-.9.58-1.36c.16-.39.31-.78.46-1.17c.18-.47.36-.95.52-1.43c.13-.38.26-.77.39-1.16c.16-.5.32-1 .47-1.51c.11-.38.21-.76.32-1.15c.14-.53.28-1.06.41-1.59c.09-.37.17-.74.25-1.12c.12-.56.24-1.12.35-1.69c.07-.35.12-.71.18-1.06c.1-.6.2-1.2.28-1.81c.04-.32.08-.64.11-.97c.08-.65.16-1.3.22-1.96c.02-.25.03-.5.05-.75c.06-.74.1-1.49.14-2.24h-2.21z'/%3E%3C/defs%3E%3Cpath fill='%2300ffdd' d='M103.06 60.5c7.19-3.2 21.36-9.27 21.36-9.27s-13.29-5.46-20.26-8.47c3.03-2.47 17.55-9.52 17.55-9.52l-22.15 1.83l12.22-29.53S92.54 20.15 85.07 22.02c.03-3.43.1-12.51.1-12.51s-6.81 7.46-10.19 9.97C71.05 13.65 63.54 4.72 63.54 4.72s-6.71 8.21-10.41 13.87C50.09 16.13 41.94 4.58 41.94 4.58s1.88 14.07 1.72 17.74c-7.8-1.87-22.21-8.37-22.21-8.37S27.69 25.79 30 31.86c-4.23-.03-18.39-.8-23.45-1.11c4.09 3.1 21.17 15.44 21.17 15.44L3.58 50.87s17.17 4.15 24.14 7.16c-1.7 1.38-6.13 4.93-9.69 7.77h91.4c-2.31-1.83-4.44-3.59-6.37-5.3'/%3E%3ClinearGradient id='notoExplodingHead1' x1='64.117' x2='64.117' y1='60.706' y2='67.834' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23630b73'/%3E%3Cstop offset='1' stop-color='%23039be5'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23notoExplodingHead1)' d='M48.28 45.33h31.67v20.48H48.28z'/%3E%3Cpath fill='%23ffea5c' d='M120.13 54.86c.19-.5.3-1.03.3-1.59c0-2.5-2.03-4.53-4.53-4.53c-2.07 0-3.8 1.4-4.34 3.3a4.51 4.51 0 0 0-2.99 4.24c0 2.5 2.03 4.53 4.53 4.53c.29 0 .57-.03.85-.09c.62.32 1.31.52 2.06.52c2.5 0 4.53-2.03 4.53-4.53c0-.65-.16-1.28-.41-1.85'/%3E%3Cpath fill='%233b4cee' d='M103.31 6.31a4.197 4.197 0 0 0-2.44 5.42c.49 1.29 1.54 2.18 2.77 2.54A4.203 4.203 0 0 0 109 16.6a4.197 4.197 0 0 0 2.44-5.42c-.49-1.29-1.54-2.18-2.77-2.54c-.87-2.09-3.23-3.14-5.36-2.33'/%3E%3Cpath fill='%23007300' d='M19.42 49.18a3.45 3.45 0 1 0-6.84-.65c0 .52.12 1 .32 1.44c-2 .1-3.64 1.69-3.76 3.74a3.98 3.98 0 0 0 3.74 4.2c1.35.08 2.58-.53 3.36-1.52c.53.32 1.15.52 1.81.56a3.98 3.98 0 0 0 4.2-3.74c.11-1.87-1.1-3.52-2.83-4.03'/%3E%3Cellipse cx='14.87' cy='17' fill='%23f73762' rx='5' ry='4.5'/%3E%3Cellipse cx='113.28' cy='24.83' fill='%23ff17c8' rx='5' ry='4.5'/%3E%3Cpath fill='%23d2d' d='M99.74 31.65c-.86-.48-1.11-1.62-.76-2.54c.53-1.38.86-2.85.94-4.37c.46-8.78-7.23-15.98-17.13-15.88c-3.49.03-6.74.99-9.49 2.59c-2.29-4.48-7.2-7.56-12.89-7.5c-5.9.07-10.88 3.5-12.94 8.28c-1.49-.48-3.07-.74-4.7-.73c-8.02.07-13.82 4.78-13.24 13.57c.1 1.49 1.28 4.3 1.28 4.3s-2.41.59-4.39 3.93c-1.61 2.71-1.78 7.08-.38 9.96c2.19 4.51 8.27 6.63 12.79 4.46c.64-.31 1.37-.7 2.03-.43c.33.14 1.71 5.2 14.13 7.78c7.16 1.49 15.56-3.76 16.03-3.77c.54-.01 1.02.32 1.47.62c0 0 3.32 3.81 10.75 2.03c7.01-1.67 7.69-6.43 8.29-6.62c.48-.15 8.7 2.43 12.17-5.44c1.52-3.52-1.07-8.63-3.96-10.24'/%3E%3Cpath fill='%23731983' d='M29.45 24.11c.06 1.25.35 4.6 1.88 5.54c1.03.63 1.95.93 2.76 1.03c1.57.19 2.52-1.75 1.46-2.92c-1.16-1.27-2.41-3.45-2.89-7.1c-.69-5.15 3.36-7.74 3.36-7.74s-6.96 2.82-6.57 11.19'/%3E%3Cpath fill='%23630b73' d='M103.66 41.91c1-2.26.66-5.45-1.16-7.49c0 0 1.11 2.89-.29 5.76c-1.42 2.91-4.43 5.63-7.57 4.88c-1.96-.47-.04-3.69-2.8-8.43c.14 4.47.05 14.6-13.07 15.44c-2.4.15-8.15-1.92-8.49-5.4c-.76-7.58 6.44-6.53 7.47-6.37c2.47.37 5.17-.7 5.58-2.65c.37-1.77-.49-2.47-1.3-3.17c-2.32-1.98-5.97-1.61-8.55.03c-3.92 2.5-5.73 9.12-8.84 12.33c-3.63 3.74-9.51 4.64-14.52 3.2c-8.58-2.47-11.26-13.41-11.26-13.41c-1.12 2.86-.13 6.62.56 8.3c-8.55 1.77-12.82-2.68-14.14-3.98c.14.8.37 1.59.73 2.33c2.19 4.51 8.27 6.63 12.79 4.46c.64-.31 1.37-.7 2.03-.43c.33.14 1.71 5.2 14.13 7.78c7.16 1.49 15.56-3.76 16.03-3.77c.54-.01 1.02.32 1.47.62c0 0 3.32 3.81 10.75 2.03c7.01-1.67 7.69-6.43 8.29-6.62c.48-.16 8.7 2.42 12.16-5.44'/%3E%3Cpath fill='%23731983' d='M67.06 5.42s1.33 1.9 1.6 2.89c1.05 3.87-.93 6.44-1.5 7.49c-.3.56-.57 1.21-.36 1.8c.23.64.93.98 1.59 1.08c1.78.29 3.63-.69 4.62-2.19c.97-1.5 2.74-7.52-5.95-11.07m31.92 23.69c.53-1.38.86-2.85.94-4.37c.18-3.38-.86-6.51-2.76-9.1c.95 1.73 1.19 3.88.79 5.84c-.55 2.67-2.26 5-4.24 6.87c-2.41 2.27-.7 3.32.69 3.32c3.35-.01 4.39-2.07 4.58-2.56'/%3E%3Cpath fill='%23039be5' d='M70.5 65.8v-6.72c0-1.26-1.12-2.28-2.5-2.28s-2.5 1.02-2.5 2.28v6.72zm-9.88 0V55.56c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5V65.8z'/%3E%3CradialGradient id='notoExplodingHead2' cx='63.72' cy='-2088.9' r='56.957' gradientTransform='matrix(1 0 0 -1 0 -2026)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='.5' stop-color='%23bdc4c7'/%3E%3Cstop offset='.919' stop-color='%23375353'/%3E%3Cstop offset='1' stop-color='%23a700b5'/%3E%3C/radialGradient%3E%3Cpath fill='url(%23notoExplodingHead2)' d='M63.72 118.8c15.4 0 29.8-5.2 40.4-14.5c10.83-9.61 16.87-22.86 17.53-38.5H5.79c1.48 36.38 30.74 53 57.93 53'/%3E%3Cpath fill='%2333a3c3' d='M13.54 92.86c.15.25.33.48.49.73c-.1-.17-.21-.34-.31-.5c-.06-.08-.13-.15-.18-.23'/%3E%3Cuse href='%23notoExplodingHead0'/%3E%3Cuse href='%23notoExplodingHead0'/%3E%3Cpath fill='%2333a3c3' d='M121.51 68.04c.06-.74.11-1.49.14-2.24h-.01c-.03.75-.08 1.5-.13 2.24'/%3E%3CradialGradient id='notoExplodingHead3' cx='63.72' cy='-2088.9' r='56.957' gradientTransform='matrix(1 0 0 -1 0 -2026)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='.5' stop-color='%23bdc4c7'/%3E%3Cstop offset='.919' stop-color='%23375353'/%3E%3Cstop offset='1' stop-color='%23a700b5'/%3E%3C/radialGradient%3E%3Cpath fill='url(%23notoExplodingHead3)' d='M121.51 68.04c.06-.74.11-1.49.14-2.24h-.01c-.03.75-.08 1.5-.13 2.24'/%3E%3Cpath fill='%23370037' d='M77.93 104.94c0 5.6-6.19 8.89-13.82 8.89s-13.82-3.29-13.82-8.89s6.19-11.69 13.82-11.69s13.82 6.09 13.82 11.69'/%3E%3Ccircle cx='41.6' cy='75.13' r='15.51' fill='%23fdd'/%3E%3Cellipse cx='41.6' cy='75.13' fill='%23370037' rx='6.67' ry='6.77'/%3E%3Ccircle cx='86.6' cy='75.13' r='15.51' fill='%23fdd'/%3E%3Cellipse cx='86.62' cy='75.21' fill='%23370037' rx='6.67' ry='6.77'/%3E%3C/svg%3E");

}
</style>
</head>
<main class="noto--exploding-head">
  </main>
add_filter( 'media_library_infinite_scrolling', '__return_true' );
add_filter( 'admin_footer_text', function ( $text ) {
    return sprintf(
        'Thank you for visiting %s',
        esc_url( home_url() ),
        esc_html( get_bloginfo( 'name' ) )
    );
} );
function rd_duplicate_post_as_draft(){
  global $wpdb;
  if (! ( isset( $_GET['post']) || isset( $_POST['post'])  || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) {
    wp_die('No post to duplicate has been supplied!');
  }

  /*
   * Nonce verification
   */
  $nonce_url = wp_nonce_url('admin.php?action=rd_duplicate_post_as_draft&post=' . absint($_GET['post']), basename(__FILE__), 'duplicate_nonce');
  if ( empty( $_GET['duplicate_nonce'] ) || ! wp_verify_nonce( $_GET['duplicate_nonce'], 'duplicate_nonce' ) ) {
    wp_die('Security check failed.');
  }

  /*
   * get the original post id
   */
  $post_id = absint( $_GET['post'] );
  /*
   * and all the original post data then
   */
  $post = get_post( $post_id );

  /*
   * if you don't want the current user to be the new post author,
   * then change the next couple of lines to this: $new_post_author = $post->post_author;
   */
  $current_user = wp_get_current_user();
  $new_post_author = $current_user->ID;

  /*
   * if post data exists, create the post duplicate
   */
  if (isset( $post ) && $post != null) {

    /*
     * new post data array
     */
    $args = array(
      'comment_status' => $post->comment_status,
      'ping_status'    => $post->ping_status,
      'post_author'    => $new_post_author,
      'post_content'   => $post->post_content,
      'post_excerpt'   => $post->post_excerpt,
      'post_name'      => $post->post_name,
      'post_parent'    => $post->post_parent,
      'post_password'  => $post->post_password,
      'post_status'    => 'draft',
      'post_title'     => $post->post_title,
      'post_type'      => $post->post_type,
      'to_ping'        => $post->to_ping,
      'menu_order'     => $post->menu_order
    );

    /*
     * insert the post by wp_insert_post() function
     */
    $new_post_id = wp_insert_post( $args );

    /*
     * get all current post terms and set them to the new post draft
     */
    $taxonomies = get_object_taxonomies($post->post_type); // returns array of taxonomy names for post type, ex array("category", "post_tag");
    foreach ($taxonomies as $taxonomy) {
      $post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs'));
      wp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);
    }

    /*
     * duplicate all post meta just in two SQL queries
     */
    $post_meta_infos = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id");
    if (count($post_meta_infos)!=0) {
      $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) ";
      foreach ($post_meta_infos as $meta_info) {
        $meta_key = $meta_info->meta_key;
        if( $meta_key == '_wp_old_slug' ) continue;
        $meta_value = addslashes($meta_info->meta_value);
        $sql_query_sel[]= "SELECT $new_post_id, '$meta_key', '$meta_value'";
      }
      $sql_query .= implode(" UNION ALL ", $sql_query_sel);
      $wpdb->query($sql_query);
    }

    /*
     * finally, redirect to the edit post screen for the new draft
     */
    wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_post_id ) );
    exit;
  } else {
    wp_die('Post creation failed, could not find the original post: ' . $post_id);
  }
}
add_action( 'admin_action_rd_duplicate_post_as_draft', 'rd_duplicate_post_as_draft' );

/*
 * Add the duplicate link to action list for post_row_actions
 */
function rd_duplicate_post_link( $actions, $post ) {
  if (current_user_can('edit_posts') && in_array($post->post_type, array('post', 'page'))) {
    $nonce_url = wp_nonce_url('admin.php?action=rd_duplicate_post_as_draft&post=' . $post->ID, basename(__FILE__), 'duplicate_nonce');
    $actions['duplicate'] = 'Duplicate';
  }
  return $actions;
}

add_filter( 'post_row_actions', 'rd_duplicate_post_link', 10, 2 );
add_filter( 'page_row_actions', 'rd_duplicate_post_link', 10, 2 );
/**
 * Convert Uploaded Images to WebP Format
 *
 * This snippet converts uploaded images (JPEG, PNG, GIF) to WebP format
 * automatically in WordPress. Ideal for use in a theme's functions.php file,
 * or with plugins like Code Snippets or WPCodeBox.
 * 
 * @package    WordPress_Custom_Functions
 * @autor      Mark Harris
 * @link       www.christchurchwebsolutions.co.uk
 *
 * Usage Instructions:
 * - Add this snippet to your theme's functions.php file, or add it as a new
 *   snippet in Code Snippets or WPCodeBox.
 * - The snippet hooks into WordPress's image upload process and converts
 *   uploaded images to the WebP format.
 *
 * Optional Configuration:
 * - By default, the original image file is deleted after conversion to WebP.
 *   If you prefer to keep the original image file, simply comment out or remove
 *   the line '@unlink( $file_path );' in the wpturbo_handle_upload_convert_to_webp function.
 *   This will preserve the original uploaded image file alongside the WebP version.
 */

add_filter('wp_handle_upload', 'wpturbo_handle_upload_convert_to_webp');

function wpturbo_handle_upload_convert_to_webp($upload) {
    if ($upload['type'] == 'image/jpeg' || $upload['type'] == 'image/png' || $upload['type'] == 'image/gif') {
        $file_path = $upload['file'];

        // Check if ImageMagick or GD is available
        if (extension_loaded('imagick') || extension_loaded('gd')) {
            $image_editor = wp_get_image_editor($file_path);
            if (!is_wp_error($image_editor)) {
                $file_info = pathinfo($file_path);
                $dirname   = $file_info['dirname'];
                $filename  = $file_info['filename'];

                // Create a unique file path for the WebP image
                $def_filename = wp_unique_filename($dirname, $filename . '.webp');
                $new_file_path = $dirname . '/' . $def_filename;

                // Attempt to save the image in WebP format
                $saved_image = $image_editor->save($new_file_path, 'image/webp');
                if (!is_wp_error($saved_image) && file_exists($saved_image['path'])) {
                    // Success: replace the uploaded image with the WebP image
                    $upload['file'] = $saved_image['path'];
                    $upload['url']  = str_replace(basename($upload['url']), basename($saved_image['path']), $upload['url']);
                    $upload['type'] = 'image/webp';

                    // Optionally remove the original image
                    @unlink($file_path);
                }
            }
        }
    }

    return $upload;
}
git clone git@github.com:thespacedoctor/sherlock.git
cd sherlock
python setup.py install
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{

    public Transform target;
    public Vector3 offset;

    // Update is called once per frame
    void Update()
    {
        transform.position = target.position + offset;
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
    public float moveSpeed;
    public float jumpForce;
    public Rigidbody rig;

    private bool isGrounded;


    // Update is called once per frame
    void Update()
    {
        float x = Input.GetAxisRaw("Horizontal") * moveSpeed;
        float z = Input.GetAxisRaw("Vertical") * moveSpeed;

        rig.velocity = new Vector3(x, rig.velocity.y, z);

        Vector3 vel = rig.velocity;
        vel.y = 0;
        if (vel.x != 0 || vel.z != 0)
        {
            transform.forward = rig.velocity;
        }

        if(Input.GetKeyDown(KeyCode.Space) && isGrounded == true)
        {
            isGrounded = false;
            rig.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
        }
    }

    void OnCollisionEnter(Collision collision)
    {
        if(collision.GetContact(0).normal == Vector3.up)
        {
            isGrounded = true;
        }
    }
}
.elementor-button-icon {line-height:0;}

.elementor-button-content-wrapper {align-items: center}
{
  "FFlagAXAccessoryAdjustment": "True",
  "FFlagAddArialToLegacyContent": "False",
  "FFlagAccessoryAdjustmentEnabled3": "True",
  "FIntDebugForceMSAASamples": "1",
  "DFFlagESGamePerfMonitorEnabled": "False",
  "FFlagEnableV3MenuABTest3": "False",
  "FFlagLuaAppsEnableParentalControlsTab": "False",
  "FFlagVoiceBetaBadge": "false",
  "FFlagDebugDisableTelemetryV2Event": "True",
  "FFlagDebugDisableTelemetryV2Counter": "True",
  "DFFlagDebugPerfMode": "True",
  "FIntMeshContentProviderForceCacheSize": "268435456",
  "FIntFRMMinGrassDistance": "0",
  "FIntTerrainOTAMaxTextureSize": "1024",
  "FFlagDebugDisableTelemetryEphemeralStat": "True",
  "FFlagRenderPerformanceTelemetry": "False",
  "FFlagEnableNewFontNameMappingABTest2": "False",
  "FIntRenderShadowIntensity": "0",
  "FFlagAXAccessoryAdjustmentIXPEnabledForAll": "True",
  "FIntRenderGrassDetailStrands": "0",
  "FFlagTopBarUseNewBadge": "false",
  "FIntFullscreenTitleBarTriggerDelayMillis": "3600000",
  "FFlagAdServiceEnabled": "False",
  "FIntStartupInfluxHundredthsPercentage": "0",
  "FFlagEnableInGameMenuControls": "True",
  "FFlagEnableReportAbuseMenuRoactABTest2": "False",
  "FIntUITextureMaxRenderTextureSize": "1024",
  "FFlagEnableInGameMenuChromeABTest3": "False",
  "FFlagEnableVisBugChecks27": "True",
  "FFlagNullCheckCloudsRendering": "True",
  "FFlagDebugSkyGray": "True",
  "FFlagDebugDisableTelemetryEphemeralCounter": "True",
  "DFIntAvatarFaceChatHeadRollLimitDegrees": "360",
  "FIntRenderLocalLightUpdatesMin": "1",
  "FFlagPreloadTextureItemsOption4": "True",
  "FIntRenderLocalLightUpdatesMax": "1",
  "DFIntUserIdPlayerNameLifetimeSeconds": "86400",
  "FFlagFixGraphicsQuality": "True",
  "DFFlagUseVisBugChecks": "True",
  "FStringVoiceBetaBadgeLearnMoreLink": "null",
  "FIntHSRClusterSymmetryDistancePercent": "10000",
  "FFlagEnableReportAbuseMenuRoact2": "false",
  "FFlagDebugDisableOTAMaterialTexture": "true",
  "FFlagGraphicsGLEnableSuperHQShadersExclusion": "False",
  "FFlagEnableMenuControlsABTest": "False",
  "FFlagLuaAppUseUIBloxColorPalettes1": "true",
  "FFlagDisableFeedbackSoothsayerCheck": "False",
  "FFlagEnableQuickGameLaunch": "False",
  "FIntDefaultMeshCacheSizeMB": "256",
  "FIntFRMMaxGrassDistance": "0",
  "FFlagAddGothamToLegacyContent": "False",
  "FFlagPreloadMinimalFonts": "True",
  "DFIntTimestepArbiterThresholdCFLThou": "300",
  "FFlagUserHideCharacterParticlesInFirstPerson": "True",
  "FFlagAXAccessoryAdjustmentIXPEnabled": "True",
  "FFlagControlBetaBadgeWithGuac": "false",
  "FFlagEnableInGameMenuModernization": "True",
  "FFlagEnableMenuModernizationABTest2": "False",
  "FFlagDebugDisableTelemetryEventIngest": "True",
  "FIntReportDeviceInfoRollout": "0",
  "FFlagTaskSchedulerLimitTargetFpsTo2402": "False",
  "FIntCameraMaxZoomDistance": "99999",
  "FIntRobloxGuiBlurIntensity": "0",
  "DFIntAssetPreloading": "9999999",
  "FFlagLuaAppEnableFoundationColors": "True",
  "FFlagGraphicsSettingsOnlyShowValidModes": "True",
  "FFlagUIBloxUseNewThemeColorPalettes": "true",
  "FFlagPreloadAllFonts": "True",
  "FFlagEnableMenuModernizationABTest": "False",
  "FFlagLuaAppChartsPageRenameIXP": "False",
  "FFlagEnableBetterHapticsResultHandling": "True",
  "FFlagRenderGpuTextureCompressor": "True",
  "FFlagEnableNewInviteMenuIXP2": "False",
  "FFlagDebugDisableTelemetryV2Stat": "True",
  "FFlagEnableReportAbuseMenuLayerOnV3": "false",
  "FFlagGraphicsGLEnableHQShadersExclusion": "False",
  "FFlagDebugGraphicsPreferD3D11": "True",
  "FFlagRenderCheckThreading": "True",
  "FFlagEnableBetaBadgeLearnMore": "false",
  "FFlagDebugDisableTelemetryPoint": "True",
  "DFIntNumAssetsMaxToPreload": "9999999",
  "FFlagEnableInGameMenuChromeABTest2": "False",
  "FFlagAXAvatarFetchResultCamelCase": "True",
  "FIntTerrainArraySliceSize": "0",
  "FFlagEnableInGameMenuChrome": "False",
  "FFlagDisablePostFx": "True",
  "FFlagBetaBadgeLearnMoreLinkFormview": "false",
  "FFlagEnableFavoriteButtonForUgc": "true",
  "FFlagEnableAudioOutputDevice": "false",
  "DFFlagDisableDPIScale": "True",
  "FFlagUIBloxDevUseNewFontNameMapping": "False",
  "FFlagEnableCommandAutocomplete": "False",
  "FFlagRenderFixFog": "True",
  "FIntEnableVisBugChecksHundredthPercent27": "100",
  "FFlagUpdateHealthBar": "True",
  "FIntGameGridFlexFeedItemTileNumPerFeed": "0",
  "FIntGrassMovementReducedMotionFactor": "0",
  "FFlagLuaAppGenreUnderConstruction": "False",
  "FFlagChatTranslationEnableSystemMessage": "False",
  "FFlagToastNotificationsProtocolEnabled2": "False",
  "DFIntDebugFRMQualityLevelOverride": "1"
}
selector {
  aspect-ratio: 1200 / 600; 
  background-color: tomato; 
  mask-image: url("/* SVG URL */");
  -webkit-mask-image: url("/* SVG URL also here */");
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-size: 100% auto;
  -webkit-mask-size: 100% auto;
  /* mask-size: contain; */
  /* -webkit-mask-size: contain; */
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":powerup-shroom: Boost Day Thursday, October 10th :powerup-shroom:",
				"emoji": true
			}
		},
		{
			"type": "rich_text",
			"elements": [
				{
					"type": "rich_text_section",
					"elements": [
						{
							"type": "text",
							"text": "Hi everyone,\n\nPower up with these Boost Day perks!\n\n"
						},
						{
							"type": "emoji",
							"name": "coffee",
							"unicode": "2615"
						},
						{
							"type": "text",
							"text": " Xero Cafe: ",
							"style": {
								"bold": true
							}
						},
						{
							"type": "text",
							"text": "Enjoy coffee and café-style beverages from our partner, Blue Sparrow, by showing your Xero ID\n"
						},
						{
							"type": "text",
							"text": "Be sure to hit the tip button before you walk away.",
							"style": {
								"code": true
							}
						},
						{
							"type": "text",
							"text": "\n\n\n"
						},
						{
							"type": "emoji",
							"name": "burrito",
							"unicode": "1f32f",
							"style": {
								"bold": true
							}
						},
						{
							"type": "text",
							"text": "  Lunch",
							"style": {
								"bold": true
							}
						},
						{
							"type": "text",
							"text": ": "
						},
						{
							"type": "emoji",
							"name": "pokeball-shake",
							"style": {
								"bold": true,
								"italic": true
							}
						},
						{
							"type": "text",
							"text": " Poke House!",
							"style": {
								"bold": true,
								"italic": true
							}
						},
						{
							"type": "text",
							"text": "\n"
						},
						{
							"type": "emoji",
							"name": "beers",
							"unicode": "1f37b",
							"style": {
								"bold": true,
								"italic": true
							}
						},
						{
							"type": "text",
							"text": "  Happy Hour: Hispanic themed Kahoot, drinks, and light snacks ",
							"style": {
								"bold": true,
								"italic": true
							}
						},
						{
							"type": "text",
							"text": "Sponsored by Los Xeros ERG for Hispanic Heritage Month from 4-5pm\n\n"
						},
						{
							"type": "text",
							"text": "Come say farewell",
							"style": {
								"bold": true,
								"italic": true
							}
						},
						{
							"type": "emoji",
							"name": "bye-1",
							"style": {
								"bold": true,
								"italic": true
							}
						},
						{
							"type": "text",
							"text": " to ",
							"style": {
								"bold": true,
								"italic": true
							}
						},
						{
							"type": "user",
							"user_id": "U02PGT7HTD0",
							"style": {
								"bold": true,
								"italic": true
							}
						},
						{
							"type": "text",
							"text": " ",
							"style": {
								"bold": true,
								"italic": true
							}
						}
					]
				}
			]
		}
	]
}
ejemplo en carga_operaciones del sistema de sig indicadores, este es el formulario


<div class="col-xs-4" style="display: block;" id='id_estado'>
                                                    <?= $form->field($model, 'id_estado')->dropDownList(ArrayHelper::map(Estados::find()/*->where(['id_municipio'=> 2])*/->orderBy('desc_estado')->all(), 'id_estado', 'desc_estado'), ['prompt' => 'Seleccione ', 'id' => 'id-estado']); ?>
                                                </div>

                                                <div class="col-xs-4" style="display: block;" id='id_municipio'>

                                                    <?= $form->field($model, 'id_municipio')->widget(DepDrop::classname(), [
                                                        'options' => ['id' => 'id-ubicacion'],
                                                        'data' => $model->isNewRecord ? [] : ArrayHelper::map(Municipios::find()->where([ 'id_estado'=>$model->id_estado])->orderBy('desc_municipio')->asArray()->all(), 'id_municipio', 'desc_municipio'),
                                                        // ensure at least the preselected value is available
                                                        'pluginOptions' => [
                                                            'depends' => ['id-estado'],
                                                            // the id for cat attribute
                                                            'placeholder' => 'Seleccione un municipio...',
                                                            'url' => Url::to(['municipios/listar'])
                                                        ]
                                                    ]);
                                                    ?>
                                                </div>

                                                <div class="col-xs-4" style=" display: block;" id='id_parroquia'>
                                                    <?= $form->field($model, 'id_parroquia')->widget(DepDrop::classname(), [
                                                        //'options'=>['id'=>'co_art_'.$regla->cod_linea.''],

                                                        'data' => $model->isNewRecord ? [] : ArrayHelper::map(Parroquias::find()->where(['id_municipio'=>$model->id_municipio])->orderBy('desc_parroquia')->asArray()->all(), 'id_parroquia', 'desc_parroquia'),
                                                        // ensure at least the preselected value is available
                                                        'pluginOptions' => [
                                                            'depends' => ['id-ubicacion'],
                                                            // the id for cat attribute
                                                            'placeholder' => 'Seleccione una parroquia...',
                                                            'url' => Url::to(['parroquias/listar'])
                                                        ]
                                                    ]);
                                                    ?>
                                                </div>

este es el modelo de carga operaciones es decir el mismo:

public function getMunicipio()
  {
    if ($this->id_municipio):
      $p = Municipios::findOne(['id_municipio' => $this->id_municipio]);
      if ($p):
        $p = $p->desc_municipio;
      endif;
    else:
      $p = "";
    endif;

    return $p;
  }

  public function getParroquia()
  {
    if ($this->id_parroquia):
      $p = Parroquias::findOne(['id_parroquia' => $this->id_parroquia]);
      if ($p):
        $p = $p->desc_parroquia;
      endif;
    else:
      $p = "";
    endif;

    return $p;
  }

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Player Details</title>
    <style>
        body {
            font-family: Arial, sans-serif;
        }
        .header {
            background-color: #00e6e6;
            color: white;
            padding: 10px;
            text-align: center;
            font-size: 24px;
            font-weight: bold;
        }
        .player-list {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
        }
        .player-card {
            border: 1px solid #ccc;
            width: 30%;
            margin: 15px;
            text-align: center;
            padding: 10px;
            box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
        }
        .player-card img {
            width: 150px;
            height: auto;
        }
        .player-card h3 {
            color: teal;
        }
        .player-card p {
            font-size: 16px;
            margin: 5px 0;
        }
        .update-btn {
            background-color: lightblue;
            border: none;
            padding: 10px;
            cursor: pointer;
        }
        .popup {
            display: none;
            position: fixed;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            background-color: white;
            padding: 20px;
            box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.5);
        }
        .popup input, .popup button {
            margin: 10px 0;
            padding: 10px;
        }
    </style>
</head>
<body>

<div class="header">Player Details</div>

<div class="player-list" id="player-list">
    <!-- Player cards will be dynamically generated here -->
</div>

<!-- Popup for updating rank -->
<div class="popup" id="update-popup">
    <h3>Update The Rank</h3>
    <p id="player-name">Player Name</p>
    <label for="rank">Rank:</label>
    <input type="number" id="rank" min="1">
    <br>
    <button id="saveButton">SaveUpdate</button>
    <button onclick="closePopup()">Cancel</button>
</div>

<script>
    const players = [
        {name: "MS Dhoni", role: "Batsman", matches: 206, rank: 13, img: "https://app.e-box.co.in/uploads/Image/6107/dhoni.png"},
        {name: "Ravendra Jadeja", role: "Batsman", matches: 185, rank: 17, img: "https://app.e-box.co.in/uploads/Image/6107/jadeja.png"},
        {name: "Rohit Sharma", role: "Bowler", matches: 165, rank: 21, img: "https://app.e-box.co.in/uploads/Image/6107/sharma.png"},
        {name: "Suresh Raina", role: "Bowler", matches: 135, rank: 35, img: "https://app.e-box.co.in/uploads/Image/6107/raina.png"},
        {name: "Virat Kohli", role: "Batsman", matches: 190, rank: 12, img: "https://app.e-box.co.in/uploads/Image/6107/kohli.png"},
        {name: "Yuvraj Singh", role: "Bowler", matches: 142, rank: 26, img: "https://app.e-box.co.in/uploads/Image/6107/yuvaraj.png"}
    ];

    let currentPlayer = null;

    function displayPlayers() {
        const playerList = document.getElementById('player-list');
        playerList.innerHTML = '';
        players.forEach((player, index) => {
            const playerCard = `
                <div class="player-card" id="player${index + 1}">
                    <img src="${player.img}" alt="${player.name}">
                    <h3>${player.name}</h3>
                    <p>Role: ${player.role}</p>
                    <p>Total Matches: ${player.matches}</p>
                    <p>Rank: <span id="player-rank${index + 1}">${player.rank}</span></p>
                    <button class="update-btn" id="player-button${index + 1}" onclick="openPopup(${index})">Update Player</button>
                </div>
            `;
            playerList.innerHTML += playerCard;
        });
    }

    function openPopup(index) {
        currentPlayer = index;
        document.getElementById('player-name').textContent = players[index].name;
        document.getElementById('rank').value = players[index].rank;
        document.getElementById('update-popup').style.display = 'block';
    }

    function closePopup() {
        document.getElementById('update-popup').style.display = 'none';
    }

    document.getElementById('saveButton').addEventListener('click', function() {
        const newRank = document.getElementById('rank').value;
        if (currentPlayer !== null && newRank) {
            players[currentPlayer].rank = newRank;
            document.getElementById(`player-rank${currentPlayer + 1}`).textContent = newRank;
            closePopup();
        }
    });

    // Display the player cards on page load
    displayPlayers();
</script>

</body>
</html>
   
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Playlist Generator</title>
    <style>
        textarea {
            width: 100%;
            height: 150px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }
        table, th, td {
            border: 1px solid black;
        }
        th, td {
            padding: 8px;
            text-align: left;
        }
        th {
            background-color: #f2f2f2;
        }
    </style>
</head>
<body>

<h2>XML Parsing to Display Playlist</h2>

<textarea id="input">
<songs>
    <song rating="4.5">
        <name>Hum thu hi</name>
        <artist>Arijit</artist>
        <movie>Aashiqui 2</movie>
    </song>
    <song rating="4.0">
        <name>Thu hi mera</name>
        <artist>Sunidhi Chauhan</artist>
        <movie>Special 26</movie>
    </song>
</songs>
</textarea>
<br>
<button id="genform">Generate Playlist</button>

<div id="playlist"></div>

<script>
    document.getElementById('genform').addEventListener('click', function() {
        // Get the XML from the textarea
        const xmlText = document.getElementById('input').value;
        
        // Parse the XML string
        const parser = new DOMParser();
        const xmlDoc = parser.parseFromString(xmlText, 'text/xml');
        
        // Get all the song elements
        const songs = xmlDoc.getElementsByTagName('song');
        
        // Start building the HTML for the table
        let table = '<table><tr><th>Title</th><th>Artist</th><th>Movie</th><th>Rating</th></tr>';
        
        // Loop through the songs and extract the information
        for (let i = 0; i < songs.length; i++) {
            const name = songs[i].getElementsByTagName('name')[0].textContent;
            const artist = songs[i].getElementsByTagName('artist')[0].textContent;
            const movie = songs[i].getElementsByTagName('movie')[0].textContent;
            const rating = songs[i].getAttribute('rating');
            
            table += `<tr><td>${name}</td><td>${artist}</td><td>${movie}</td><td>${rating}</td></tr>`;
        }
        
        // Close the table HTML
        table += '</table>';
        
        // Insert the table into the playlist div
        document.getElementById('playlist').innerHTML = table;
    });
</script>

</body>
</html>
   
star

Tue Oct 15 2024 14:37:49 GMT+0000 (Coordinated Universal Time)

@Belle #c++

star

Tue Oct 15 2024 14:08:05 GMT+0000 (Coordinated Universal Time)

@Shira

star

Tue Oct 15 2024 11:10:40 GMT+0000 (Coordinated Universal Time)

@wheedo

star

Tue Oct 15 2024 08:41:59 GMT+0000 (Coordinated Universal Time)

@wheedo

star

Tue Oct 15 2024 08:01:45 GMT+0000 (Coordinated Universal Time) https://medium.com/geekculture/top-nft-business-ideas-60e2913e264c

@LilianAnderson #nftbusiness #nftmonetaryvalue #startupopportunities #nftentrepreneurship #nftbusinessideas2024

star

Tue Oct 15 2024 07:25:45 GMT+0000 (Coordinated Universal Time)

@ziaurrehman #html

star

Tue Oct 15 2024 04:39:37 GMT+0000 (Coordinated Universal Time) https://developer.mozilla.org/en-US/docs/Web/API/Document/scrollingElement

@cbmontcw

star

Tue Oct 15 2024 04:37:59 GMT+0000 (Coordinated Universal Time) https://developer.mozilla.org/en-US/docs/Web/API/Document/prerendering

@cbmontcw

star

Tue Oct 15 2024 04:34:30 GMT+0000 (Coordinated Universal Time) https://codepen.io/jensimmons/pen/dybKOxm

@cbmontcw

star

Tue Oct 15 2024 04:29:38 GMT+0000 (Coordinated Universal Time) https://codepen.io/jensimmons/pen/poGBroL

@cbmontcw

star

Tue Oct 15 2024 04:18:46 GMT+0000 (Coordinated Universal Time) https://codepen.io/jensimmons/pen/XmYyeP

@cbmontcw

star

Tue Oct 15 2024 04:16:36 GMT+0000 (Coordinated Universal Time) https://codepen.io/jemin/pen/RwaqNoz?editors

@cbmontcw

star

Tue Oct 15 2024 04:10:24 GMT+0000 (Coordinated Universal Time) https://webkit.org/blog/13096/css-has-pseudo-class/#styling-form-states-without-js

@cbmontcw

star

Tue Oct 15 2024 04:08:58 GMT+0000 (Coordinated Universal Time) https://webkit.org/blog/13096/css-has-pseudo-class/

@cbmontcw ##css ##themes ##lightdark

star

Tue Oct 15 2024 01:38:45 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Mon Oct 14 2024 16:56:21 GMT+0000 (Coordinated Universal Time) https://dynacodeing.wordpress.com/2020/03/04/exporting-the-data-from-data-entities-through-x-code/

@pavankkm

star

Mon Oct 14 2024 16:54:35 GMT+0000 (Coordinated Universal Time) https://community.dynamics.com/forums/thread/details/?threadid

@pavankkm

star

Mon Oct 14 2024 16:03:20 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/Face_DandR

@Praanesh #python

star

Mon Oct 14 2024 12:29:45 GMT+0000 (Coordinated Universal Time)

@CodeWithSachin #aggregation #mongodb #$objecttoarray #$addfiels

star

Mon Oct 14 2024 12:29:37 GMT+0000 (Coordinated Universal Time) https://maticz.com/cryptocurrency-development-company

@jamielucas #drupal

star

Mon Oct 14 2024 11:32:07 GMT+0000 (Coordinated Universal Time)

@Alexlotl

star

Mon Oct 14 2024 11:28:23 GMT+0000 (Coordinated Universal Time)

@utp #c++

star

Mon Oct 14 2024 10:32:36 GMT+0000 (Coordinated Universal Time) https://www.google.com/search?q

@cbmontcw

star

Mon Oct 14 2024 07:45:40 GMT+0000 (Coordinated Universal Time)

@dark

star

Mon Oct 14 2024 06:26:47 GMT+0000 (Coordinated Universal Time) https://woshub.com/hide-safely-remove-hardware-icon-windows/#:~:text=To%20safely%20remove,be%20safely%20unplugged.

@Curable1600 #windows

star

Mon Oct 14 2024 05:53:14 GMT+0000 (Coordinated Universal Time) https://github.com/waynechungvs/awesome-lwc-collection

@WayneChung

star

Mon Oct 14 2024 05:31:47 GMT+0000 (Coordinated Universal Time) https://travelsaga.com/new-year-party-dubai

@travelsaga #newyearparty #dubainewyearparty #newyearcelebration #newyeareve

star

Mon Oct 14 2024 05:07:45 GMT+0000 (Coordinated Universal Time) https://www.elevenforum.com/t/driverstoreexplorer-shows-many-entries-how-to-remove-non-essential-drivers.24260/#:~:text=Export%20all%20your%20drivers%20%22just%20in%20case%22.%20To%20do%20so%2C%20run%20these%20two%20commands%20from%20an%20elevated%20command%20prompt%3A%0A%0AMD%20C%3A%5CDrivers_Backup%0Apnputil%20/export%2Ddriver%20*%20C%3A%5CDrivers_Backup

@Curable1600 #windows

star

Mon Oct 14 2024 02:33:17 GMT+0000 (Coordinated Universal Time) https://salesforcetime.com/2024/10/12/using-returl-to-redirect-users-when-flows-finish/

@WayneChung

star

Mon Oct 14 2024 00:28:29 GMT+0000 (Coordinated Universal Time)

@deshmukhvishal2 #cpp

star

Sun Oct 13 2024 21:44:58 GMT+0000 (Coordinated Universal Time)

@EPICCodeMaster #css

star

Sun Oct 13 2024 19:26:16 GMT+0000 (Coordinated Universal Time) https://ferdy.com/the-best-code-snippets-for-wordpress/

@Y@sir

star

Sun Oct 13 2024 19:26:07 GMT+0000 (Coordinated Universal Time) https://ferdy.com/the-best-code-snippets-for-wordpress/

@Y@sir

star

Sun Oct 13 2024 19:25:53 GMT+0000 (Coordinated Universal Time) https://ferdy.com/the-best-code-snippets-for-wordpress/

@Y@sir

star

Sun Oct 13 2024 19:25:25 GMT+0000 (Coordinated Universal Time) https://ferdy.com/the-best-code-snippets-for-wordpress/

@Y@sir #convertall images to webp

star

Sun Oct 13 2024 19:24:45 GMT+0000 (Coordinated Universal Time) https://qub-sherlock.readthedocs.io/en/master/install.html

@JD3970

star

Sun Oct 13 2024 19:24:41 GMT+0000 (Coordinated Universal Time) https://qub-sherlock.readthedocs.io/en/master/install.html

@JD3970

star

Sun Oct 13 2024 14:34:58 GMT+0000 (Coordinated Universal Time)

@iliavial #c#

star

Sun Oct 13 2024 14:27:41 GMT+0000 (Coordinated Universal Time)

@iliavial #c#

star

Sun Oct 13 2024 11:17:52 GMT+0000 (Coordinated Universal Time)

@webisko #css

star

Sat Oct 12 2024 11:30:00 GMT+0000 (Coordinated Universal Time)

@enojiro7

star

Sat Oct 12 2024 09:56:39 GMT+0000 (Coordinated Universal Time) https://www.cron24.com/airbnb-clone

@jackveeranan #airbnbcloneapp #airbnbclonescript #airbnbclone

star

Sat Oct 12 2024 09:54:57 GMT+0000 (Coordinated Universal Time) https://www.cron24.com/blog/what-is-an-airbnb-clone-script

@jackveeranan #airbnbclone #airbnbcloneapp #airbnbclonescript

star

Sat Oct 12 2024 09:01:19 GMT+0000 (Coordinated Universal Time) https://www.scribd.com/document/602427248/DOWNLOADER-CODES-LIST

@Jondar

star

Sat Oct 12 2024 07:17:45 GMT+0000 (Coordinated Universal Time) https://gist.github.com/wpacademy/39d1268583daa1dae84ec571f236f6da#file-mask-css-L1

@Umar

star

Fri Oct 11 2024 20:20:10 GMT+0000 (Coordinated Universal Time)

@ncdiep

star

Fri Oct 11 2024 18:34:49 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

star

Fri Oct 11 2024 12:19:20 GMT+0000 (Coordinated Universal Time)

@adsj

star

Fri Oct 11 2024 12:18:39 GMT+0000 (Coordinated Universal Time)

@adsj

Save snippets that work with our extensions

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