Snippets Collections
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>
   
            <Conditional condition={data.admin}>
              <Link href="/secure/admin//data/menteith-updater" passHref>
                <NavigationMenuLink>
                  <UserCog size={16} className="me-2" />
                  Menteith Updater
                </NavigationMenuLink>
              </Link>
            </Conditional>
import React, { useState } from "react";
import { useDropzone } from "react-dropzone";
import * as XLSX from "xlsx";
import {
  BackHomeButton,
  CommandPalletteButton,
  MinimalPage,
  PageHeading,
} from "ui";
import { BugReportButton, CommandInterface, Navigation } from "@/components";

interface VesselManagerRecord {
  IMONumber: string;
  EffectiveControl: string;
}

const UpdateVesselManager: React.FC = () => {
  const [file, setFile] = useState<File | null>(null);
  const [tableData, setTableData] = useState<VesselManagerRecord[]>([]);

  const onDrop = (acceptedFiles: File[]) => {
    const uploadedFile = acceptedFiles[0];
    setFile(uploadedFile);

    const reader = new FileReader();
    reader.onload = (e) => {
      const data = e.target?.result;
      const workbook = XLSX.read(data, { type: "binary" });
      const worksheet = workbook.Sheets["Recent Changes (EffControl)"];
      const jsonData = XLSX.utils.sheet_to_json<VesselManagerRecord>(worksheet);
      setTableData(jsonData);
    };
    reader.readAsBinaryString(uploadedFile);
  };

  const { getRootProps, getInputProps } = useDropzone({ onDrop });

  return (
    <MinimalPage
      pageTitle={"Update Vessel Manager | Vessel Interface"}
      pageDescription={"Vessel Interface | Update Vessel Manager"}
    >
      <div className="flex w-full flex-row justify-between pl-1 pt-1">
        <div>
          <BackHomeButton />
        </div>
        <Navigation />
        <div className="flex flex-row gap-4">
          <BugReportButton />
          <CommandPalletteButton />
          <CommandInterface />
        </div>
      </div>

      <PageHeading text="Update Vessel Manager" />

      <div className="mt-6 flex w-full flex-col gap-2 p-2 sm:w-1/2">
        <div className="mt-4">
          <div
            {...getRootProps({
              className:
                "dropzone border-2 border-dashed p-4 rounded-md text-center cursor-pointer text-white",
            })}
          >
            <input {...getInputProps()} />
            <p>
              Drag & drop a vessel manager update file here, or click to select
              one
            </p>
          </div>
        </div>

        {file && (
          <div className="mt-4">
            <p className="text-white">File: {file.name}</p>
          </div>
        )}

        {tableData.length > 0 && (
          <div className="mt-6 overflow-x-auto">
            <table className="min-w-full border-collapse border border-gray-400">
              <thead>
                <tr>
                  <th className="border border-gray-300 px-4 py-2 text-white">
                    IMO Number
                  </th>
                  <th className="border border-gray-300 px-4 py-2 text-white">
                    Effective Control
                  </th>
                </tr>
              </thead>
              <tbody>
                {tableData.map((record, index) => (
                  <tr key={index}>
                    <td className="border border-gray-300 px-4 py-2 text-white">
                      {record.IMONumber}
                    </td>
                    <td className="border border-gray-300 px-4 py-2 text-white">
                      {record.EffectiveControl}
                    </td>
                  </tr>
                ))}
              </tbody>
            </table>
          </div>
        )}
      </div>
    </MinimalPage>
  );
};

export default UpdateVesselManager;
// Update manager - Raf
export async function updateVesselManagerInDB(imo: string, managerId: number) {
  return new Promise<void>((resolve, reject) => {
    rdsConnection.query(
      `UPDATE spotship_vessel SET manager_id = ? WHERE imo = ?`,
      [managerId, imo],
      (error: unknown) => {
        if (error) {
          return reject(error);
        }
        return resolve();
      }
    );
  });
}
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import classification_report, confusion_matrix

data = pd.read_csv('email.csv')
data['Message'] = data['Message'].str.lower()
data['Category'] = data['Category'].map({'spam': 1, 'ham': 0})
data = data.dropna(subset=['Category'])

X_train, X_test, y_train, y_test = train_test_split(data['Message'], data['Category'], test_size=0.2, random_state=42)

vectorizer = TfidfVectorizer(stop_words='english')
X_train_tfidf = vectorizer.fit_transform(X_train)
X_test_tfidf = vectorizer.transform(X_test)

model = MultinomialNB()
model.fit(X_train_tfidf, y_train)
y_pred = model.predict(X_test_tfidf)

print(confusion_matrix(y_test, y_pred))
print(classification_report(y_test, y_pred))
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn import metrics
from sklearn.linear_model import LinearRegression

df = pd.read_csv("Housing.csv")
newdf = df[["price", "bedrooms"]]
X = newdf.drop(['price'], axis=1)
Y = newdf['price']

X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2, random_state=2)

model = LinearRegression()
model.fit(X_train, Y_train)
Y_predict = model.predict(X_test)

score_1 = metrics.r2_score(Y_test, Y_predict)
score_2 = metrics.mean_absolute_error(Y_test, Y_predict)
score_3 = metrics.mean_squared_error(Y_test, Y_predict)

print('Mean Squared Error:', score_3)
print('R Squared Error:', score_1)
print('Mean Absolute Error:', score_2)
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":magic_wand::xero-unicorn: Xeros Connect: End of Year Celebration – A Sprinkle of Magic! :xero-unicorn::magic_wand:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Hi Singapore!* \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": "*📅 When:* Wednesday 11th December"
				},
				{
					"type": "mrkdwn",
					"text": "*📍 Where:*\n<https://www.google.com/maps?sca_esv=81b62b241f3359c7&rlz=1C5GCCM_en&output=search&q=oche&source=lnms&fbs=AEQNm0AeMNWKf4PpcKMI-eSa16lJoRPMIuyspCxWO6iZW9F1Nu5UXlEfGU2YX1CrW9Nmm9Q3JIJZUqyMsLxos5tPU_UnM4mnBED_NsBtYJwhu9OaLjQpzn0pySwUSKm9zjjZ6FJf82N0QSPjwpHS_aSKjAkyDvchej2j7Ds2GJq122SoPsxeojGz9Q9KyJmfY-CpwM5u4MZVBK_r1kLudCbP3X7_BXmLQg&entry=mc&ved=1t:200715&ictx=111|*Oche Clarke Quay*> \n#01-05/06 Riverside Point, 30 Merchant Road, Singapore 058282"
				},
				{
					"type": "mrkdwn",
					"text": "*⏰ Time:*\n4PM - 7PM"
				}
			]
		},
		{
			"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!\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! :sparkle-sparkle:)"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🚍 Transport Info:* Please make your own way to the event venue. The nearest MRT station is Clarke Quay and takes 3-5 mins on foot."
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎤 :hamburger: Entertainment & Food:*\nPrepare for a game of darts at Oche alongside delicious bites and refreshing drinks! ✨🎶"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*:admission_tickets: RSVP Now:* Click<https://xero-wx.jomablue.com/reg/store/eoy_sgp|* here*> to RSVP! Make sure you RSVP by *_Friday, 22nd 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\n We can’t wait to celebrate with you! :partying_face: :xero-love:"
			}
		}
	]
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":magic_wand::xero-unicorn: Xeros Connect: End of Year Celebration – A Sprinkle of Magic! :xero-unicorn::magic_wand:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Hi Perth!* \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": "*📅 When:*\nFriday 13th December"
				},
				{
					"type": "mrkdwn",
					"text": "*📍 Where:*\n<https://www.google.com/maps?sca_esv=d161937f2a63904d&rlz=1C5GCCM_en&output=search&q=Leederville+Sporting+Club+Inc&source=lnms&fbs=AEQNm0AeMNWKf4PpcKMI-eSa16lJoRPMIuyspCxWO6iZW9F1NsHpGSbY6p65aYtb0pKhithD3nYIUrgYcer9L65Lp5hOnCqfrWx3I5HhZsSL93Fgy5Zqgq5vAS4DA73LOERqmDqhPhBwQhXhQFypczALGOnzgRlIDqMs7LIDX30Ew_emgrbF_rTyrRSHFOAQJWIU3rWBoTxMR8QlHGZYK_4CuMD857Hikw&entry=mc&ved=1t:200715&ictx=111|*Leederville Sporting Club*> \n78 Cambridge St, West Leederville WA 6007"
				},
				{
					"type": "mrkdwn",
					"text": "*⏰ Time:*\n12PM - 5PM"
				}
			]
		},
		{
			"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!\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! :sparkle-sparkle:)"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🚍 Transport Info:* Please make your own way to the event venue."
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎤 :hamburger: Entertainment & Food:*\nPrepare for a game of lawn bowl activity at the Leederville Sporting Club Inc, followed by delicious bites and refreshing drinks after at Servo Restaurant! ✨🎶"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎟 RSVP Now:* Click<https://xero-wx.jomablue.com/reg/store/eoy_per|* here*> to RSVP! Make sure you RSVP by *_Wednesday, 20th 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\n We can’t wait to celebrate with you! :partying_face: :xero-love:"
			}
		}
	]
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: What's on in Melbourne this week! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n Hey Melbourne, happy Monday! Please see below for what's on this week. "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Xero Café :coffee:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n :new-thing: *This week we are offering:* \n\n Double Dipped Finger Biscuits, Chocolate Chip Cookies, and Caramel & Macadamia Slice (Gluten Free) \n\n *Weekly Café Special*: _ Caramel Iced Latte_"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " Wednesday, 16th October :calendar-date-16:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n:icecream: *Afternoon Tea*: From *2pm* in the L3 kitchen + breakout space! \n\n:massage:*Wellbeing - Yin Yoga & Breathwork*: Confirm your spot <https://docs.google.com/spreadsheets/d/1iKMQtSaawEdJluOmhdi_r_dAifeIg0JGCu7ZSPuwRbo/edit?gid=0#gid=0/|*here*>. Please note we have a maximum of 15 participants per class, a minimum notice period of 2 hours is required if you can no longer attend. \n\n :eat-up: Our last Eat Up sandwich making session for the year! Register <https://docs.google.com/forms/d/e/1FAIpQLSfGWtG8mfkCu-gltX0M3fL-SmB3m4i-sOIK3-9qj1lCm1P9dg/viewform?usp=sf_link|*here*> to join in on the fun!"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Thursday, 17th October :calendar-date-17:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":breakfast: *Breakfast*: Provided by *Kartel Catering* from *8:30am - 10:30am* in the Wominjeka Breakout Space.\n\n"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Later this month:* We have our Hackathon Themed Social+ on the 31st of October! \n\nStay tuned to this channel for more details, and make sure you're subscribed to the <https://calendar.google.com/calendar/u/0?cid=Y19xczkyMjk5ZGlsODJzMjA4aGt1b3RnM2t1MEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Melbourne Social Calendar*> :party-wx:"
			}
		}
	]
}
import logging
from telegram import Update
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext
from collections import defaultdict
import time
from threading import Thread

# Enable logging
logging.basicConfig(
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    level=logging.INFO
)
logger = logging.getLogger(__name__)

# Predefined admin user ID
ADMIN_ID = 123456789  # Replace with your actual Telegram user ID

# Store user data
user_media_count = defaultdict(int)
shared_content = defaultdict(list)  # Store content temporarily
whitelist = set()  # Whitelisted user IDs
banned_users = set()  # Banned user IDs
user_deadlines = {}  # Deadlines for media submissions

# Cleanup function to remove expired content
def cleanup_expired_content():
    while True:
        current_time = time.time()
        for user_id in list(user_deadlines.keys()):
            if current_time >= user_deadlines[user_id]:
                banned_users.add(user_id)
                del user_deadlines[user_id]
                logger.info(f"User {user_id} has been banned for not submitting media.")
        time.sleep(60)  # Check every minute

# Start command
def start(update: Update, context: CallbackContext) -> None:
    user_id = update.message.from_user.id
    if user_id in banned_users:
        return  # No response for banned users

    user_deadlines[user_id] = time.time() + 86400  # 24 hours in seconds
    update.message.reply_text(
        'Welcome to the Anonymous Sharing Bot! '
        'You need to send 2 media files within 24 hours to remain in the bot. '
        'Share media files to gain access to shared content or send a message anonymously.'
    )

# Countdown command
def countdown(update: Update, context: CallbackContext) -> None:
    user_id = update.message.from_user.id
    if user_id in banned_users:
        return  # No response for banned users

    if user_id in user_deadlines:
        remaining_time = int(user_deadlines[user_id] - time.time())
        if remaining_time > 0:
            hours, remainder = divmod(remaining_time, 3600)
            minutes, seconds = divmod(remainder, 60)
            update.message.reply_text(f"You have {hours} hours, {minutes} minutes, and {seconds} seconds left to submit your media.")
        else:
            update.message.reply_text("Your time has expired. You have been banned.")
    else:
        update.message.reply_text("You haven't started the submission process yet.")

# Help command
def help_command(update: Update, context: CallbackContext) -> None:
    commands = (
        "/start - Start using the bot\n"
        "/help - Show this help message\n"
        "/countdown - Check remaining time to submit media\n"
        "/wl_add <user_id> - Whitelist a user\n"
        "/ban <user_id> - Ban a user\n"
        "/delban <message_id> - Delete a message and ban the user\n"
        "/forward <media_id> - Forward media to your own cloud or group"
    )
    update.message.reply_text(f"Available commands:\n{commands}")

# Acknowledgment for media uploads
def acknowledge_upload(update: Update, context: CallbackContext) -> None:
    update.message.reply_text("Your media has been received successfully!")

# Add to whitelist command
def wl_add(update: Update, context: CallbackContext) -> None:
    if update.message.from_user.id != ADMIN_ID:
        update.message.reply_text("You do not have permission to whitelist users.")
        return
    
    if not context.args:
        update.message.reply_text("Please provide a Telegram ID to whitelist.")
        return
    
    user_id = int(context.args[0])
    whitelist.add(user_id)
    update.message.reply_text(f"User {user_id} has been whitelisted.")

# Ban command
def ban_user(update: Update, context: CallbackContext) -> None:
    if update.message.from_user.id != ADMIN_ID:
        update.message.reply_text("You do not have permission to ban users.")
        return
    
    user_id = update.message.reply_to_message.from_user.id if update.message.reply_to_message else None
    if user_id:
        banned_users.add(user_id)
        del user_deadlines[user_id]  # Remove deadline if user is banned
        update.message.reply_text(f"User {user_id} has been banned from using the bot.")
    else:
        update.message.reply_text("No user found to ban.")

# Delete and ban command
def delban(update: Update, context: CallbackContext) -> None:
    if update.message.from_user.id != ADMIN_ID:
        update.message.reply_text("You do not have permission to use this command.")
        return

    if not context.args:
        update.message.reply_text("Please provide the message ID to delete and ban the user.")
        return

    message_id = int(context.args[0])
    user_id = update.message.reply_to_message.from_user.id if update.message.reply_to_message else None

    if user_id:
        banned_users.add(user_id)
        del user_deadlines[user_id]  # Remove deadline if user is banned
        try:
            chat_id = update.effective_chat.id
            context.bot.delete_message(chat_id=chat_id, message_id=message_id)
            update.message.reply_text(f"Message {message_id} has been deleted and user {user_id} has been banned.")
        except Exception as e:
            logger.error(f"Error deleting message or banning user: {e}")
            update.message.reply_text("An error occurred while trying to delete the message or ban the user.")
    else:
        update.message.reply_text("No user found to ban.")

# Handle media messages
def handle_media(update: Update, context: CallbackContext) -> None:
    user_id = update.message.from_user.id
    
    if user_id in banned_users:
        return  # No response for banned users

    user_media_count[user_id] += 1

    try:
        if update.message.photo:
            media_type = "image"
            media = update.message.photo[-1].file_id
        elif update.message.video:
            media_type = "video"
            media = update.message.video.file_id
        else:
            update.message.reply_text('Please share an image or video.')
            return

        shared_content[user_id].append({'type': media_type, 'media': media, 'timestamp': time.time()})
        
        acknowledge_upload(update, context)  # Acknowledge the upload

        # Reset timer if the user has sent enough media
        if user_media_count[user_id] <= 2:
            user_deadlines[user_id] = time.time() + 86400  # Reset deadline to 24 hours from now
            if user_media_count[user_id] == 2:
                update.message.reply_text('Thank you for sharing 2 media files! You are allowed to stay in the bot.')

        if user_media_count[user_id] >= 5:
            update.message.reply_text('Thank you for sharing! You now have access to all shared content.')

        # Notify user of their media count
        update.message.reply_text(f"You have uploaded {user_media_count[user_id]} media files.")

    except Exception as e:
        logger.error(f"Error handling media from user {user_id}: {e}")
        update.message.reply_text("An error occurred while processing your media. Please try again.")

# Forward media to user-defined destinations
def forward_media(update: Update, context: CallbackContext) -> None:
    if not context.args:
        update.message.reply_text("Please provide the media ID you want to forward.")
        return

    media_id = context.args[0]
    user_id = update.message.from_user.id

    # Check if media exists for the user
    if user_id in shared_content:
        for content in shared_content[user_id]:
            if content['media'] == media_id:
                if content['type'] == 'image':
                    context.bot.send_photo(chat_id=update.effective_chat.id, photo=media_id)
                elif content['type'] == 'video':
                    context.bot.send_video(chat_id=update.effective_chat.id, video=media_id)
                update.message.reply_text("Media has been forwarded successfully.")
                return
    update.message.reply_text("Media not found.")

# Handle text messages
def handle_text(update: Update, context: CallbackContext) -> None:
    user_id = update.message.from_user.id

    if user_id in banned_users:
        return  # No response for banned users

    if user_media_count[user_id] < 5:
        update.message.reply_text('You need to share 5 media files first to access this feature.')
        return

    try:
        shared_content[user_id].append({'type': 'text', 'message': update.message.text, 'timestamp': time.time()})
        update.message.reply_text('Your anonymous message has been shared!')

    except Exception as e:
        logger.error(f"Error handling text from user {user_id}: {e}")
        update.message.reply_text("An error occurred while sharing your message. Please try again.")

def main() -> None:
    # Create Updater and pass it your bot's token
    updater = Updater("YOUR_BOT_TOKEN")  # Replace with your bot token

    # Get the dispatcher to register handlers
    dp = updater.dispatcher

    # Register handlers
    dp.add_handler(CommandHandler("start", start))
    dp.add_handler(CommandHandler("countdown", countdown))
    dp.add_handler(CommandHandler("help", help_command))
    dp.add_handler(CommandHandler("wl_add", wl_add))
    dp.add_handler(CommandHandler("ban", ban_user))
    dp.add_handler(CommandHandler("delban", delban))
    dp.add_handler(MessageHandler(Filters.photo | Filters.video, handle_media))
    dp.add_handler(MessageHandler(Filters.text & ~Filters.command, handle_text))

    # Start the Bot
    updater.start_polling()

    # Start the cleanup thread
    Thread(target=cleanup_expired_content, daemon=True).start()

    # Run the bot until you send a signal to stop
    updater.idle()

if __name__ == '__main__':
    main()
@AuraEnabled
    public static void updateContactAndAccountRecords(List<Map<String, Object>> updatedRecords) {
        system.debug(updatedRecords + ' updatedRecords');
        List<Contact> contactsToUpdate = new List<Contact>();
        List<Account> accountsToUpdate = new List<Account>();

        for (Map<String, Object> record : updatedRecords) {
            
            if (record.containsKey('Id')) {
                Contact c = new Contact();
                c.Id = (String) record.get('Id');
                
                if (record.containsKey('Phone')) {
                    c.Phone = (String) record.get('Phone');
                }
                contactsToUpdate.add(c);
            }

            
            if (record.containsKey('AccountId')) {
                Account a = new Account();
                a.Id = (String) record.get('AccountId');
                Boolean hasOtherFields = false;

                if (record.containsKey('AccountName')) {
                    a.Name = (String) record.get('AccountName');  
                    hasOtherFields = true; 
                }
                if (record.containsKey('AccountIndustry')) {
                    a.Industry = (String) record.get('AccountIndustry');
                    hasOtherFields = true; 
                }
                if (record.containsKey('AccountShippingCountry')) {
                    a.ShippingCountry = (String) record.get('AccountShippingCountry');
                    hasOtherFields = true;
                }
            
               
                if (hasOtherFields) {
                    accountsToUpdate.add(a);
                }
            }
        }

        
        if (!contactsToUpdate.isEmpty()) {
            update contactsToUpdate; 
        }
        if (!accountsToUpdate.isEmpty()) {
            update accountsToUpdate; 
        }
    }
<div class="avia-button-wrap avia-button-center black-button popup-cta">
    <span class="popmake-1101 avia-button avia-size-large avia-position-left avia-color-theme-color">
        <span class="avia_iconbox_title">Book Now</span>
    </span>
</div>
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

star

Fri Oct 11 2024 08:01:43 GMT+0000 (Coordinated Universal Time)

@rafal_rydz

star

Fri Oct 11 2024 07:58:52 GMT+0000 (Coordinated Universal Time)

@rafal_rydz

star

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

@wayneinvein

star

Fri Oct 11 2024 03:09:13 GMT+0000 (Coordinated Universal Time)

@wayneinvein

star

Fri Oct 11 2024 01:47:09 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Fri Oct 11 2024 01:37:08 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Fri Oct 11 2024 00:17:19 GMT+0000 (Coordinated Universal Time)

@WXAPAC

star

Thu Oct 10 2024 22:21:06 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/

@johnsoap1

star

Thu Oct 10 2024 18:49:08 GMT+0000 (Coordinated Universal Time) https://help.shodan.io/command-line-interface/0-installation

@edzukation

star

Thu Oct 10 2024 11:58:15 GMT+0000 (Coordinated Universal Time) https://pairbytes.com/rummy-game-development-company/

@johnandrew24 #rummy #game

star

Thu Oct 10 2024 11:56:23 GMT+0000 (Coordinated Universal Time)

@Nandha #apex

star

Thu Oct 10 2024 06:47:02 GMT+0000 (Coordinated Universal Time)

@omnixima #javascript

Save snippets that work with our extensions

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