Snippets Collections
public class MathOperations {

    // Method to add two integers
    public int add(int a, int b) {
        return a + b;
    }

    // Method to add three integers
    public int add(int a, int b, int c) {
        return a + b + c;
    }

    // Method to add two doubles
    public double add(double a, double b) {
        return a + b;
    }

    // Method to concatenate two strings
    public String add(String a, String b) {
        return a + b;
    }

    public static void main(String[] args) {
        MathOperations math = new MathOperations();

        // Test the overloaded methods
        System.out.println("Addition of two integers: " + math.add(10, 20));
        System.out.println("Addition of three integers: " + math.add(10, 20, 30));
        System.out.println("Addition of two doubles: " + math.add(10.5, 20.5));
        System.out.println("Concatenation of two strings: " + math.add("Hello", " World"));
    }
}
import java.util.Scanner;

public class GradeCalculator {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // Prompt the user to enter a score
        System.out.print("Enter the score: ");
        int score = scanner.nextInt();

        // Determine the grade based on the score
        String grade;
        if (score >= 90 && score <= 100) {
            grade = "A";
        } else if (score >= 80 && score < 90) {
            grade = "B";
        } else if (score >= 70 && score < 80) {
            grade = "C";
        } else if (score >= 60 && score < 70) {
            grade = "D";
        } else if (score >= 0 && score < 60) {
            grade = "F";
        } else {
            grade = "Invalid score";
        }

        // Print the grade
        System.out.println("The grade is: " + grade);

        scanner.close();
    }
}
public class CommandLineSum {
    public static void main(String[] args) {
        int sum = 0;

        // Check if there are command line arguments
        if (args.length == 0) {
            System.out.println("No command line arguments found.");
            return;
        }

        // Iterate through the command line arguments
        for (String arg : args) {
            try {
                // Convert argument to integer and add to sum
                int num = Integer.parseInt(arg);
                sum += num;
            } catch (NumberFormatException e) {
                System.out.println(arg + " is not a valid integer.");
            }
        }

        // Print the sum of integers
        System.out.println("Sum of integers: " + sum);
    }
}
function getList(){
	var olist = [];
	var cont = {};
	var orders = $(".m-order-card");
	var rlist = [];
	for(var j=0; j<orders.length; j++){
		var iorder = orders[j];
		var order = {};
		var descr = $(iorder).find(".section-notice__main").text();
		order.purchaseDate = descr.match("[0-9]{2}\. ...\. [0-9]{4}")[0];
		order.totals = descr.match("EUR [0-9]{1,4},[0-9]{2}")[0];
		var cards = $(iorder).find(".m-item-card");
		for(var i=0;i<cards.length;i++){
			var card = cards[i];
			var item = {};
			var itemLink = $(card).find(".container-item-col-item-info").find(".container-item-col__info-item-info-title").find("div").find("a");
			item.title = itemLink.text();
			item.link = itemLink.attr("href");
			var props = $(card).find(".container-item-col__info-item-info-aspectValuesList").find("div");
			item.property = "";
			for(var m=0; m<props.length; m++){
				item.property += $(props[m]).text();
				if(m<props.length-1)item.property += "; "
			}
			
			item.image = $(card).find(".container-item-col-img").find("img").attr("src");
			item.price = $(card).find(".container-item-col__info-item-info-additionalPrice").find("div").find("span").text();
			olist.push(item);
		}
		order.items = olist;
		rlist.push(order);
	}
	
	cont.purchases = rlist;
	console.log(JSON.stringify(cont));
}
const http = require('node:http')
const fs = require('node:fs')

const mime = {
  'html': 'text/html',
  'css': 'text/css',
  'jpg': 'image/jpg',
  'ico': 'image/x-icon',
  'mp3': 'audio/mpeg3',
  'mp4': 'video/mp4'
}

const servidor = http.createServer((pedido, respuesta) => {
  const url = new URL('http://localhost:8888' + pedido.url)
  let camino = 'static' + url.pathname
  if (camino == 'static/')
    camino = 'static/index.html'
  fs.stat(camino, error => {
    if (!error) {
      fs.readFile(camino, (error, contenido) => {
        if (error) {
          respuesta.writeHead(500, { 'Content-Type': 'text/plain' })
          respuesta.write('Error interno')
          respuesta.end()
        } else {
          const vec = camino.split('.')
          const extension = vec[vec.length - 1]
          const mimearchivo = mime[extension]
          respuesta.writeHead(200, { 'Content-Type': mimearchivo })
          respuesta.write(contenido)
          respuesta.end()
        }
      })
    } else {
      respuesta.writeHead(404, { 'Content-Type': 'text/html' })
      respuesta.write('<!doctype html><html><head></head><body>Recurso inexistente</body></html>')
      respuesta.end()
    }
  })
})

servidor.listen(8888)

console.log('Servidor web iniciado')
let Wid = window.innerWidth;

		if (Wid > 1199) {
			const section = document.querySelector('.services .services-main');
			const wrapper = document.querySelector('.services .container');
			const wrapperInner = document.querySelector('.services__wrapper-inner');
			const oneCard = document.querySelector('.services__content');

			const totalWidth = wrapperInner.scrollWidth - wrapper.clientWidth;
			const startTrigger = $('.services .row').hasClass('first-row')
				? 'top -=30%top'
				: 'top top';
			const gsapConfig = {
				x: () => {
					return -(
						wrapper.scrollWidth -
						window.innerWidth +
						window.innerWidth * 0.05 +
						(window.innerWidth / 2 - oneCard.offsetWidth / 2)
					);
				},

				scrollTrigger: {
					trigger: section,
					start: startTrigger,
					end: 'bottom top',
					scrub: 1,
					pin: true,
					pinSpacing: true,
					markers: false,
				},
			};
			gsap.to(wrapperInner, gsapConfig);
			ScrollTrigger.refresh();

			let navWidth = 0;
			let maxScrollerWidth = totalWidth;

			function slideAnim(e) {
				e.preventDefault();
				let direction = 1;
				if ($(this).hasClass('next-btn')) {
					direction = 1;
				} else if ($(this).hasClass('prev-btn')) {
					direction = -1;
				}

				navWidth += direction * innerWidth;

				navWidth = Math.max(0, Math.min(navWidth, maxScrollerWidth));

				gsap.to(wrapperInner, {
					duration: 0.8,
					x: -navWidth,
					ease: 'power3.out',
				});
			}

			document.querySelector('.prev-btn').addEventListener('click', slideAnim);
			document.querySelector('.next-btn').addEventListener('click', slideAnim);
		}
    export PROJECT_ID=<your project ID>
    export BUCKET_NAME=<your choice of a globally unique bucket ID>
    gcloud storage buckets create gs://$BUCKET_NAME --project=$PROJECT_ID --location=us-central1 --uniform-bucket-level-access
gcloud compute ssh llm-processor --zone=us-east4-c --project=${PROJECT_ID}
gcloud compute instances create llm-processor     --project=${PROJECT_ID}     --zone=us-east4-c     --machine-type=e2-standard-4     --metadata=enable-oslogin=true     --scopes=https://www.googleapis.com/auth/cloud-platform     --create-disk=auto-delete=yes,boot=yes,device-name=llm-processor,image-project=cos-cloud,image-family=cos-stable,mode=rw,size=250,type=projects/${PROJECT_ID}/zones/us-central1-a/diskTypes/pd-balanced 
    export PROJECT_ID=<your project ID>
    gcloud services enable cloudfunctions compute.googleapis.com iam.googleapis.com cloudresourcemanager.googleapis.com --project=${PROJECT_ID}
gcloud auth login
gcloud auth application-default login
Prompt: You are a mighty and powerful prompt-generating robot. You need to
understand my goals and objectives and then design a prompt. The prompt should
include all the relevant information context and data that was provided to you.
You must continue asking questions until you are confident that you can produce
the best prompt for the best outcome. Your final prompt must be optimized for
chat interactions. Start by asking me to describe my goal, then continue with
follow-up questions to design the best prompt.
Prompt: Can you give me a list of ideas for blog posts for tourists visiting
New York City for the first time?
INSERT INTO `logs` (`id`, `Log`, `Info`, `Ip`, `Date`, `sn`) VALUES (NULL, '<a href=\"?limit=1000&player=Sam_Mason\"><strong>Sam_Mason</strong></a> Получил Анти-Варн', '<code><strong>I:</strong></code> <code>200,000,000</code> / <code>500,000,000</code> / <code>10000</code>', '<td><div class=\"table-ip\"><strong><code>I:</code></strong><span class=\"badge badge-secondary\">127.0.1.1</span><span class=\"badge badge-primary\">127.0.0.1</span></div><div class=\"table-ip\"><strong><code>II:</code></strong> <span class=\"badge badge-secondary\">127.0.0.1</span><span class=\"badge badge-primary\">127.0.0.1</span></div></td>', '2024-06-28 05:00:00', '1')
#define amlf(%0,%1,%2,%3,%4) format(global_str, 512, %0, %4), aml(global_str, %1, %2, %3)

stock aml(string[], type, name[], name2[])
{
    f(aml_str, 1024, "INSERT INTO `%s` (`Log`, `sn`, `Ip`, `Date`) VALUE ('%s', '%d', '%s', '%s')", Mode_Logs, string, type, name, name2), CallRemoteFunction("AddLOG", "s", aml_str);
    printf("%s", aml_str);
    return 1;
}
public: AddLOG(log_string[])
{
    if WRITE_ACTION_SERVER *then {
        mysql_tquery(mysql, log_string);
    }
}

   
    amlf("<a href=\"?limit=1000&player=%s\"><strong>%s</strong></a> вошёл на сервер.", 1, "<td><div class=\"table-ip\"><strong><code>I:</code></strong><span class=\"badge badge-secondary\">%s</span><span class=\"badge badge-primary\">%s</span></div></td>","", PN(playerid), PN(playerid), PlayerIp[playerid], PlayerRegIP[playerid]);
for status in tweepy.Cursor(api.home_timeline).items(10):
    # Process a single status
    process_or_store(status._json)
 const options = {
        rootMargin: '0px 0px -200px 0px'
    }

    const observer = new IntersectionObserver((entries, observer) => {
        entries.forEach(entry => {
            if(entry.isIntersecting) {
                entry.target.classList.add('show');
                observer.unobserve(entry.target);
            } else {
                return;
            }
        })
    }, options);

    const h1 = document.querySelector('h1'); // targets one element
    observer.observe(h1);

    const paras = document.querySelectorAll('p'); 
    paras.forEach(p => observer.observe(p)); //targets multple element with a loop
// Callback function to execute when intersections are detected

const callback = (entries, observer) => {
  entries.forEach(entry => {
    if (entry.isIntersecting) {
      console.log('Element is in view');
      // Perform actions like loading images, animations, etc.
    } else {
      console.log('Element is out of view');
    }
  });
};

// Options object

const options = {
  root: null, // relative to the viewport
  rootMargin: '0px', // margin around the root
  //threshold: 0.1 // trigger callback when 10% of the element is visible
  treshold: 0, //means out of the viewport
};

// Create an instance of IntersectionObserver with the callback and options

const observer = new IntersectionObserver(callback, options);

// Target element to be observed

const target = document.querySelector('.target-element');

// Start observing the target element

observer.observe(target);
//html
 <div class="scroll-indicator">Scroll Position: <span id="scrollPos">0</span></div> 

   
   
 //js
const scrollPosElement = document.getElementById('scrollPos');

window.addEventListener('scroll', function() {
            const scrollTop = document.documentElement.scrollTop || window.pageYOffset;
            scrollPosElement.textContent = scrollTop;
        });
const functions = require('@google-cloud/functions-framework');

functions.http('helloHttp', (req, res) => {
 res.send(`Hello ${req.query.name || req.body.name || 'World'}!`);
});
Cannot GET /es/
Cannot GET /es/
<style>
.online {content:url('http://dl7.glitter-graphics.net/pub/123/123537ffm5m11zus.gif'); background-repeat: no-repeat; background-position: -15% 75%; z-index: 2; 
}
</style>

<style>
body{background:url("https://i.postimg.cc/v801vYV1/gradient.png") no-repeat fixed; background-size:cover;}
</style>

<style>
main {
  background-color: transparent;
  color: white;
border-radius: 15px}
</style>

<style>
nav .top {border-radius: 15px;
border: 5px outset #0d4b73;
 background-color: #0066A7;}
</style>

<style>
nav .links {background-color: transparent;}
</style>

<style>
footer {background-color: transparent;}
</style>

<style>
.profile .contact, .profile .table-section, .profile .url-info {
  border: 5px outset #004b7c;
border-radius: 15px;
}
</style>

<style>
.profile .contact .heading, .profile .table-section .heading, .home-actions .heading {
  background-color: #0066A7;
  color: white;
border-radius: 15px;
}
</style>

<style>
.profile .table-section .details-table td {
  background-color: #0066A7;
  color: white;
border-radius: 5px;
}
</style>

<style>
.col.w-40.left .contact {background-color: #0066A7;}
</style>

<style>
.col.w-40.left .url-info  {background-color: #0066A7;}
</style>

<style>
.profile .blurbs .heading, .profile .friends .heading {
  background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
border-radius: 15px;
}
</style>

<style>
.profile .friends .comments-table td {
  background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
border-radius: 15px;
</style>

<style>
.inner .comments-table {border: 1px transparent;}
</style>

<style>
main a {
  color: var(--white);
}
</style>

<style>
footer a {
  color: var(--white);
}
</style>

<style>
b .count {color: white;}
</style>

<style>
.profile .friends .person p{
 
    color: #fff;
}
</style>

<style>
.col.right .profile-info { background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
border-radius: 15px;}
</style>

<style>
.blurbs .section h4 {display: none !important;}
</style>

<style>
a:hover {
color: white;
font-style: ;
</style>
 
<style>
nav .links a:hover {
color: white;
font-style: ;
</style>

<style>
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');
body{font-family: 'Comic Neue', sans-serif;font-size: 120%; }

</style>

<style>
p.thick {
  font-weight: bold;
}
</style>

<style>
td .comment-replies {background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
border-radius: 15px;}
</style>

<style>

.logo {

content:url("https://i.postimg.cc/7hxx2NCc/spaceheysims-1.png");
  height: 61px!important;
    width: 125px!important;

}

</style>

<style>main:before {
	width: 100%;
	height: 240px ;
	display: block;
	content: "";
	background-image: url('https://pbs.twimg.com/media/Fx1KAzvaYAEOIdR.jpg');
	background-position: center center;
	background-size: cover;
border-radius: 20px;
}
@media only screen and (max-width: 600px) {
	main:before{
		height: 300px;
	}
}
    </style>


<style>

.online{content:url("https://i.postimg.cc/BZdJGDB2/Plumbob-The-Sims-1-1-1.png");}

</style>
    
    <style>
    button {background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
      border-radius: 5px;}
  </style>
  
  <style>
  .profile .url-info{
background: url('https://i.pinimg.com/originals/ba/2f/3a/ba2f3a6a97bc1cf9aa19ddfc8b3f2fb5.gif'); /*replace pic here*/
background-position: center;
background-size: cover;
border: var(--borders)!important;
border-radius: var(--curve);
height: 250px;
    border-radius: 10px;
} 
.url-info p{ opacity: 0.0; }
  </style>
  
  <style>
/* replace with cd image that has transparent background. must be 150px by 150px. */
:root {
--cd-image: url('https://i.postimg.cc/sg9tNHc0/CD-Front-removebg-preview-1.png');
}
.profile-pic {
position: relative;
width: 183px;
filter: drop-shadow(0 0 0.25rem gray);
}
.profile-pic:after {
content: "";
background: url('https://fluorescent-lights.neocities.org/f0rzNHe.png'), linear-gradient(150deg, rgba(255,255,255,0.4), rgba(255,255,255,0.2), 40%, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.6));
background-size: contain, cover;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

.profile-pic:before {
content: "";
background: var(--cd-image);
position: absolute;
top: 5px;
left: -20px;
width: 150px;
height: 150px;
background-repeat: no-repeat;
z-index: -1;
animation-name: spin;
animation-duration: 5000ms;
animation-iteration-count: infinite;
animation-timing-function: linear; 
transition: left ease 0.5s;
}
.profile-pic:hover:before {
left: -75px;
}
@keyframes spin {
    from {
        transform:rotate(0deg);
    }
    to {
        transform:rotate(360deg);
    }
}
.profile-pic .pfp-fallback {
float: right;
width: 163px;
height: 160px;
border: none;
}
.general-about .profile-pic img {
max-width: inherit;
}
</style>
  
  <style>
  .friends-grid .person img {border-radius: 200px;
  border: 5px outset #0d4b73;}
  
  td img {border-radius: 200px;
  border: 5px outset #0d4b73;}
  </style>
  
  <style>
.profile .friends .person img:not(.icon):hover {
    transform: scale(1.2);
    transition: 0.5s ease;
}
.profile .friends .person img:not(.icon) {
    transition: 0.5s ease
}
</style>
  
   <style>
td img:not(.icon):hover {
    transform: scale(1.2);
    transition: 0.5s ease;
}
td img:not(.icon) {
    transition: 0.5s ease
}
</style>
  
  <style>
/* width */
::-webkit-scrollbar {
  width: 20px;
}

/* Track */
::-webkit-scrollbar-track {
  box-shadow: inset 0 0 5px grey; 
  border-radius: 10px;
}
 
/* Handle */
::-webkit-scrollbar-thumb {
  background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
border-radius: 15px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #00416b; 
}
</style>

<style>

.contact .inner a img {

font-size: 0;

}

.contact .inner a img:before {

font-size: 1em;

display: block

}

</style>

<style>* {cursor: url("http://www.rw-designer.com/cursor-view/188882.png"), url("http://www.rw-designer.com/cursor-view/188882.png"), auto !important;}</style>
<style>
.online {content:url('http://dl7.glitter-graphics.net/pub/123/123537ffm5m11zus.gif'); background-repeat: no-repeat; background-position: -15% 75%; z-index: 2; 
}
</style>

<style>
body{background:url("https://i.postimg.cc/v801vYV1/gradient.png") no-repeat fixed; background-size:cover;}
</style>

<style>
main {
  background-color: transparent;
  color: white;
border-radius: 15px}
</style>

<style>
nav .top {border-radius: 15px;
border: 5px outset #0d4b73;
 background-color: #0066A7;}
</style>

<style>
nav .links {background-color: transparent;}
</style>

<style>
footer {background-color: transparent;}
</style>

<style>
.profile .contact, .profile .table-section, .profile .url-info {
  border: 5px outset #004b7c;
border-radius: 15px;
}
</style>

<style>
.profile .contact .heading, .profile .table-section .heading, .home-actions .heading {
  background-color: #0066A7;
  color: white;
border-radius: 15px;
}
</style>

<style>
.profile .table-section .details-table td {
  background-color: #0066A7;
  color: white;
border-radius: 5px;
}
</style>

<style>
.col.w-40.left .contact {background-color: #0066A7;}
</style>

<style>
.col.w-40.left .url-info  {background-color: #0066A7;}
</style>

<style>
.profile .blurbs .heading, .profile .friends .heading {
  background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
border-radius: 15px;
}
</style>

<style>
.profile .friends .comments-table td {
  background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
border-radius: 15px;
</style>

<style>
.inner .comments-table {border: 1px transparent;}
</style>

<style>
main a {
  color: var(--white);
}
</style>

<style>
footer a {
  color: var(--white);
}
</style>

<style>
b .count {color: white;}
</style>

<style>
.profile .friends .person p{
 
    color: #fff;
}
</style>

<style>
.col.right .profile-info { background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
border-radius: 15px;}
</style>

<style>
.blurbs .section h4 {display: none !important;}
</style>

<style>
a:hover {
color: white;
font-style: ;
</style>
 
<style>
nav .links a:hover {
color: white;
font-style: ;
</style>

<style>
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');
body{font-family: 'Comic Neue', sans-serif;font-size: 120%; }

</style>

<style>
p.thick {
  font-weight: bold;
}
</style>

<style>
td .comment-replies {background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
border-radius: 15px;}
</style>

<style>

.logo {

content:url("https://i.postimg.cc/7hxx2NCc/spaceheysims-1.png");
  height: 61px!important;
    width: 125px!important;

}

</style>

<style>main:before {
	width: 100%;
	height: 240px ;
	display: block;
	content: "";
	background-image: url('https://pbs.twimg.com/media/Fx1KAzvaYAEOIdR.jpg');
	background-position: center center;
	background-size: cover;
border-radius: 20px;
}
@media only screen and (max-width: 600px) {
	main:before{
		height: 300px;
	}
}
    </style>


<style>

.online{content:url("https://i.postimg.cc/BZdJGDB2/Plumbob-The-Sims-1-1-1.png");}

</style>
    
    <style>
    button {background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
      border-radius: 5px;}
  </style>
  
  <style>
  .profile .url-info{
background: url('https://i.pinimg.com/originals/ba/2f/3a/ba2f3a6a97bc1cf9aa19ddfc8b3f2fb5.gif'); /*replace pic here*/
background-position: center;
background-size: cover;
border: var(--borders)!important;
border-radius: var(--curve);
height: 250px;
    border-radius: 10px;
} 
.url-info p{ opacity: 0.0; }
  </style>
  
  <style>
/* replace with cd image that has transparent background. must be 150px by 150px. */
:root {
--cd-image: url('https://i.postimg.cc/sg9tNHc0/CD-Front-removebg-preview-1.png');
}
.profile-pic {
position: relative;
width: 183px;
filter: drop-shadow(0 0 0.25rem gray);
}
.profile-pic:after {
content: "";
background: url('https://fluorescent-lights.neocities.org/f0rzNHe.png'), linear-gradient(150deg, rgba(255,255,255,0.4), rgba(255,255,255,0.2), 40%, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.6));
background-size: contain, cover;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

.profile-pic:before {
content: "";
background: var(--cd-image);
position: absolute;
top: 5px;
left: -20px;
width: 150px;
height: 150px;
background-repeat: no-repeat;
z-index: -1;
animation-name: spin;
animation-duration: 5000ms;
animation-iteration-count: infinite;
animation-timing-function: linear; 
transition: left ease 0.5s;
}
.profile-pic:hover:before {
left: -75px;
}
@keyframes spin {
    from {
        transform:rotate(0deg);
    }
    to {
        transform:rotate(360deg);
    }
}
.profile-pic .pfp-fallback {
float: right;
width: 163px;
height: 160px;
border: none;
}
.general-about .profile-pic img {
max-width: inherit;
}
</style>
  
  <style>
  .friends-grid .person img {border-radius: 200px;
  border: 5px outset #0d4b73;}
  
  td img {border-radius: 200px;
  border: 5px outset #0d4b73;}
  </style>
  
  <style>
.profile .friends .person img:not(.icon):hover {
    transform: scale(1.2);
    transition: 0.5s ease;
}
.profile .friends .person img:not(.icon) {
    transition: 0.5s ease
}
</style>
  
   <style>
td img:not(.icon):hover {
    transform: scale(1.2);
    transition: 0.5s ease;
}
td img:not(.icon) {
    transition: 0.5s ease
}
</style>
  
  <style>
/* width */
::-webkit-scrollbar {
  width: 20px;
}

/* Track */
::-webkit-scrollbar-track {
  box-shadow: inset 0 0 5px grey; 
  border-radius: 10px;
}
 
/* Handle */
::-webkit-scrollbar-thumb {
  background-color: #0066A7;
  color: white;
border: 5px outset #004b7c;
border-radius: 15px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #00416b; 
}
</style>

<style>

.contact .inner a img {

font-size: 0;

}

.contact .inner a img:before {

font-size: 1em;

display: block

}

</style>

<style>* {cursor: url("http://www.rw-designer.com/cursor-view/188882.png"), url("http://www.rw-designer.com/cursor-view/188882.png"), auto !important;}</style>
<img src="<?= $section['right_image'] ?>" alt="<?php echo $section['url']['alt'];?>">


<img src="<?= $item['sub_image']['url']?>" alt="<?php echo $item['sub_image']['alt'];?>" title="<?php echo $item['sub_image']['title'];?>" class="box-img">
line#Line_6, line#Line_3, path#Vector_3, line#Line_5, #Vector_2, line#Line_4, line#Line_2 {
    animation: dash 25s linear infinite;
    animation-direction: reverse;
    stroke-dasharray: 5;
}
@-webkit-keyframes dash {
  to {
    stroke-dashoffset: 1000;
  }
}
# Drop rows with missing values
df = df.dropna()

# Fill missing values
df = df.fillna(value=0)
/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
//Service
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { RewardTypeViewModel } from '../shared/reward-type';
import { Observable } from 'rxjs';
import { RewardPostViewModel, RewardRedeemViewModel, RewardSetViewModel, RewardViewModel } from '../shared/reward';

@Injectable({
  providedIn: 'root'
})
export class RewardService {

  httpOptions = {
    headers: new HttpHeaders({
      'Content-Type': 'application/json'
    })
  };
  
  constructor(private http: HttpClient) {}
  apiUrl: string = "https://localhost:7185/api/Reward";

  //RewardType endpoints
  createRewardType(rewardType: RewardTypeViewModel): Observable<RewardTypeViewModel> {
    return this.http.post<RewardTypeViewModel>(`${this.apiUrl}/createRewardType`, rewardType, this.httpOptions);
  }

  getAllRewardTypes(): Observable<RewardTypeViewModel[]> {
    return this.http.get<RewardTypeViewModel[]>(`${this.apiUrl}/getAllRewardTypes`, this.httpOptions);
  }

  getRewardTypeById(id: number): Observable<RewardTypeViewModel> {
    return this.http.get<RewardTypeViewModel>(`${this.apiUrl}/getRewardTypeById/${id}`, this.httpOptions);
  }

  updateRewardType(rewardTypeId: number, rewardTypeName: string, rewardCriteria: string): Observable<void> {
    const body = { reward_Type_Name: rewardTypeName, reward_Criteria: rewardCriteria }; // Correctly format the body as JSON
    return this.http.put<void>(`${this.apiUrl}/updateRewardType/${rewardTypeId}`, body, this.httpOptions);
  }

  deleteRewardType(id: number): Observable<void> {
    return this.http.delete<void>(`${this.apiUrl}/deleteRewardType/${id}`, this.httpOptions);
  }

  //Reward endpoints
  getRewardById(id: number): Observable<RewardViewModel> {
    return this.http.get<RewardViewModel>(`${this.apiUrl}/getRewardById/${id}`, this.httpOptions);
  }  

  getAllRewards(): Observable<RewardViewModel[]> {
    return this.http.get<RewardViewModel[]>(`${this.apiUrl}/getAllRewards`, this.httpOptions);
  }

  setReward(reward: RewardSetViewModel): Observable<RewardViewModel> {
    return this.http.post<RewardViewModel>(`${this.apiUrl}/setReward`, reward, this.httpOptions);
  }

  redeemReward(request: RewardRedeemViewModel): Observable<any> {
    return this.http.post<any>(`${this.apiUrl}/redeemReward`, request, this.httpOptions);
  }

  postReward(request: RewardPostViewModel): Observable<any> {
    return this.http.post<any>(`${this.apiUrl}/postReward`, request, this.httpOptions);
  }

}

//Models
export class RewardViewModel{
    reward_ID!: number;
    reward_Issue_Date!: Date;
    reward_Type_ID!: number;
    isPosted!: boolean;
}

export class RewardRedeemViewModel {
    MemberId!: number;
    RewardId!: number;
}

export class RewardSetViewModel {
    reward_Issue_Date!: Date;
    reward_Type_ID!: number;
    isPosted: boolean = false;
}

export class RewardPostViewModel {
    RewardId!: number;
}

//Component
//TS
import { Component } from '@angular/core';
import { RewardViewModel } from '../shared/reward';
import { RewardService } from '../Services/reward.service';
import { CommonModule, Location } from '@angular/common';

@Component({
  selector: 'app-reward',
  standalone: true,
  imports: [CommonModule],
  templateUrl: './reward.component.html',
  styleUrl: './reward.component.css'
})
export class RewardComponent {
  unlistedRewards: RewardViewModel[] = [];
  listedRewards: RewardViewModel[] = [];

  constructor(private rewardService: RewardService, private location:Location) {}

  ngOnInit(): void {
    this.loadUnlistedRewards();

    this.loadListedRewards();
  }

  loadUnlistedRewards(): void {
    this.rewardService.getAllRewards().subscribe(rewards => {
      this.unlistedRewards = rewards.filter(reward => !reward.isPosted);
      console.log('Unlisted Rewards:', this.unlistedRewards);
    });
  }

  postReward(rewardId: number): void {
    const request = { RewardId: rewardId };
    this.rewardService.postReward(request).subscribe(() => {
      this.loadUnlistedRewards(); // Reload the unlisted rewards
    });
  }

  openSetRewardModal(): void {
    // Logic to open a modal for setting a new reward
  }

  loadListedRewards(): void {
    this.rewardService.getAllRewards().subscribe(rewards => {
      this.listedRewards = rewards.filter(reward => reward.isPosted);
      console.log('Listed Rewards:', this.listedRewards);
    });
  }

  goBack(): void {
  this.location.back();
  }
} 

//HTML
<div class="reward-container">
    <div class="back-button">
        <button class="btn btn-link" (click)="goBack()">
            <i class="bi bi-arrow-left-circle"></i>Back
        </button>
    </div>

    <div class="unlisted-reward-container">
        <div class="content">
            <div class="header">
                <h1>Unlisted Rewards</h1>
            </div>

            <button class="btn btn-primary mb-3" (click)="openSetRewardModal()">Set New Reward</button>

            <table class="table table-hover table-centered">
                <thead>
                  <tr>
                    <th>Reward ID</th>
                    <th>Issue Date</th>
                    <th>Reward Name</th>
                    <th>Posted</th>
                    <th>Actions</th>
                  </tr>
                </thead>
                <tbody>
                  <tr *ngFor="let reward of unlistedRewards">
                    <td>{{ reward.reward_ID }}</td>
                    <td>{{ reward.reward_Issue_Date | date }}</td>
                    <td>{{ reward.reward_Type_ID }}</td>
                    <td>{{ reward.isPosted }}</td>
                    <td>
                      <button (click)="postReward(reward.reward_ID)">Post Reward</button>
                    </td>
                  </tr>
                </tbody>
            </table>
        </div>
    </div>

    <br/>

    <div class="listed-reward-container">
        <div class="content">
            <div class="header">
                <h1>Listed Rewards</h1>
            </div>

            <table class="table table-hover table-centered">
                <thead>
                  <tr>
                    <th>Reward ID</th>
                    <th>Issue Date</th>
                    <th>Reward Name</th>
                    <th>Posted</th>
                  </tr>
                </thead>
                <tbody>
                  <tr *ngFor="let reward of listedRewards">
                    <td>{{ reward.reward_ID }}</td>
                    <td>{{ reward.reward_Issue_Date | date }}</td>
                    <td>{{ reward.reward_Type_ID }}</td>
                    <td>{{ reward.isPosted }}</td>
                  </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

//CSS
.reward-container {
    padding: 20px;
}

.back-button {
    position: absolute;
    top: 10px;
    left: 10px;
    margin-top: 70px;
}

.content {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px; /* Adjusted to move the content up */
    text-align: center; /* Center the heading */
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.table-centered th,
.table-centered td {
  text-align: center; /* Center align table contents */
}

.table-hover tbody tr:hover {
    background-color: #f1f1f1;
}

/* Custom CSS for all post images */
.post img {
    max-width: 500px; /* Limit width to 500px */
    height: auto; /* Maintain aspect ratio */
    width: 100%; /* Ensure image fills container */
    max-height: 500px; /* Limit height to 500px */
}

img {
    max-width: 500px; /* Limit width to 500px */
    height: auto; /* Maintain aspect ratio */
    width: 150%; /* Ensure image fills container */
    max-height: 500px; /* Limit height to 500px */
}

.attachment-ecomall_blog_thumb {
max-width: 350px; /* Limit width to 500px */
    height: 300px; /* Maintain aspect ratio */
    width: ; /* Ensure image fills container */
    max-height: px; /* Limit height to 500px */
}


.woocommerce .products .product a img {
    margin: ;
    box-shadow: none;
	width: 100%;
	height:250px;
    transition: 300ms ease;
}

.heading-title.product-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    height: 43px;
    font-size: inherit;
}

.price, .wishlist_table .product-price, .products .meta-wrapper > .price {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    line-height: 22px !important;
    gap: 0 6px;
}

.post_list_widget li .thumbnail, .list-posts article .entry-format figure, .ts-blogs article .thumbnail-content figure {
    overflow: hidden;
    background: floralwhite;
}

span[style="color:#b12704"] {
    display: none;
}

.post-title{
display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    height: 80px;
    font-size: 20px;
}

add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' ); 
function woocommerce_custom_single_add_to_cart_text() {
    return __( 'See Prices', 'woocommerce' ); 
}

// To change add to cart text on product archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );  
function woocommerce_custom_product_add_to_cart_text() {
    return __( 'See prices', 'woocommerce' );
}
{
  "fundRaisingId": 92,
  "fundRaisingTypeId": 16,
  "fundRaisingCategoryId": 17,
  "fundRaisingRequestForId": 121,
  "associationMemberId": 0,
  "associationId": 0,
  "title": "Fund raise for Competetion events ",
  "description": "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.",
  "currencyCode": "EUR",
  "currencyCountryId": 82,
  "targetAmount": 65000,
  "targetEndDate": "2025-01-31T00:00:00",
  "isTaxBenefitApplicable": false,
  "applicableTaxCode": "",
  "videoUrl": null,
  "fundRaiseRejectReason": null,
  "images": [
    {
      "fundRaisingGalleryId": 115,
      "imageUrl": "https://s3.ap-south-1.amazonaws.com/myassociation-dev-objects/Profile/815b7ed1-2f32-4a53-8746-f86a20d5b400.jpg"
    },
    {
      "fundRaisingGalleryId": 116,
      "imageUrl": "https://s3.ap-south-1.amazonaws.com/myassociation-dev-objects/Profile/ef37dad7-948c-4666-8a64-872d9e81808d.jpg"
    }
  ],
  "documents": [
    {
      "fundRaisingGalleryId": 114,
      "documentUrl": "https://s3.ap-south-1.amazonaws.com/myassociation-dev-objects/Profile/file-sample_100kB (1).docx"
    }
  ],
  "beneficiaryAccountDetails": {
    "fundRaisingBeneficiaryAccountId": 63,
    "fundRaisingBeneficiaryId": 96,
    "fundRaisingId": 92,
    "name": "Dhanunjay",
    "bankName": "HDFC Bank",
    "bankAccountNumber": "1234567890123",
    "bankRoutingType": "IFSC Code",
    "bankRoutingTypeId": 46,
    "bankRoutingCode": "HDFC1234",
    "isOrgAccount": false,
    "upiId": null,
    "bankingPaymentTypeId": 170
  },
  "beneficiaryDetails": {
    "fundRaisingBeneficiaryId": 96,
    "fundRaisingId": 92,
    "name": "Ram Sharma",
    "emailId": "ram@gmail.com",
    "phoneCode": "+61",
    "phoneCountryId": 14,
    "phoneNumber": 9464646463,
    "kycType": null,
    "kycTypeId": 0,
    "kycDocumentUrl": null,
    "kycVerificationStatusId": 133,
    "kycVerificationStatus": "InReview"
  },
  "linkedAsscoiations": [
    {
      "id": 144,
      "associationId": 24,
      "name": "Hyderabad medical association",
      "logoUrl": "https://s3.ap-south-1.amazonaws.com/myassociation-dev-objects/Profile/881c29e9-99da-4b42-bd18-9411f4f1efef.jpg"
    },
    {
      "id": 146,
      "associationId": 5,
      "name": "Indian Society for Clinical Research (ISCR)",
      "logoUrl": "https://s3.ap-south-1.amazonaws.com/myassociation-dev-objects/public/download (13).png"
    },
    {
      "id": 145,
      "associationId": 7,
      "name": "Student National Medical Association",
      "logoUrl": "https://s3.ap-south-1.amazonaws.com/myassociation-dev-objects/Profile/7e7662f4-1243-4330-a610-fae79e4ea4f7.jpg"
    }
  ]
}






add_filter( 'awl_labels_hooks', 'my_awl_labels_hooks2' );

function my_awl_labels_hooks2( $hooks ) {

$hooks['before_title']['archive']['sp_wpspro_before_product_title'] = array( 'priority' => 10 );

$hooks['on_image']['archive']['sp_wpspro_before_product_thumbnail'] = array( 'priority' => 10 );

return $hooks;

}
 h1.closest('header').style.backgroundColor = `var(--color-primary)`;
function testPropagation(e) {
  e.preventDefault();
  const { target } = e;
  if (target.localName !== 'a' || target.classList.contains('btn--show-modal'))
    return;
  console.log(target);
  const url = new URL(target.href);
  console.log('url', url);
}




//Expanation of new Url()

const baseURL = 'https://www.example.com/';
const url = new URL('/path/to/page', baseURL);

console.log(url.href); // "https://www.example.com/path/to/page"






const url = new URL('https://www.example.com/path/to/page?query=123');

url.protocol = 'http';
url.hostname = 'another-example.com';
url.pathname = '/new/path';
url.searchParams.set('query', '456'); // Update the query parameter
url.hash = '#newSection';

console.log(url.href); // "http://another-example.com/new/path?query=456#newSection"







const url = new URL('https://www.example.com/path?name=David&age=30');

// Get the value of a query parameter
console.log(url.searchParams.get('name')); // "David"

// Add a new query parameter
url.searchParams.append('city', 'Berlin');

// Update an existing query parameter
url.searchParams.set('age', '31');

// Remove a query parameter
url.searchParams.delete('name');

console.log(url.href); // "https://www.example.com/path?age=31&city=Berlin"
//Models
public class Reward
{
    [Key]
    public int Reward_ID { get; set; }

    [Required]
    public DateTime Reward_Issue_Date { get; set; }

    public bool IsPosted { get; set; } // New property to track posted status

    public int Reward_Type_ID { get; set; }

    [ForeignKey(nameof(Reward_Type_ID))]
    public Reward_Type Reward_Type { get; set; }

}

public class Reward_Member
{
    [Key]
    public int Reward_Member_ID { get; set; }

    public bool IsRedeemed { get; set; } // New property to track redemption status

    public int Member_ID { get; set; }

    [ForeignKey(nameof(Member_ID))]

    public Member Member { get; set; }


    public int Reward_ID { get; set; }

    [ForeignKey(nameof(Reward_ID))]

    public Reward Reward { get; set; }
}

//ViewModels
public class RewardRedeemViewModel
{

    public int MemberId { get; set; }

    public int RewardId { get; set; }
}

public class RewardSetViewModel
{
    public DateTime Reward_Issue_Date { get; set; }

    public int Reward_Type_ID { get; set; }

    public bool IsPosted { get; set; } = false;
}

public class RewardPostViewModel
{
    public int RewardId { get; set; }
}

//Controller

[Route("api/[controller]")]
[ApiController]
public class RewardController : ControllerBase
{
  private readonly AppDbContext _appDbContext;

  public RewardController(AppDbContext appDbContext)
  {
    _appDbContext = appDbContext;
  }
  
      [HttpGet]
    [Route("getRewardById/{id}")]
    public async Task<IActionResult> GetRewardById(int id)
    {
        try
        {
            var reward = await _appDbContext.Rewards.FindAsync(id);

            if (reward == null)
            {
                return NotFound();
            }

            return Ok(reward);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpGet]
    [Route("getAllRewards")]
    public async Task<IActionResult> GetAllRewards()
    {
        try
        {
            var rewards = await _appDbContext.Rewards.ToListAsync();
            return Ok(rewards);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpPost]
    [Route("redeemReward")]
    public async Task<IActionResult> RedeemReward([FromBody] RewardRedeemViewModel request)
    {
        try
        {
            // Fetch the reward by ID
            var reward = await _appDbContext.Reward_Members
                                            .FirstOrDefaultAsync(r => r.Reward_ID == request.RewardId && r.Member_ID == request.MemberId);

            if (reward == null)
            {
                return NotFound("Reward not found or not eligible for the member.");
            }

            // Check if the reward is already redeemed
            if (reward.IsRedeemed)
            {
                return BadRequest("Reward is already redeemed.");
            }

            // Mark the reward as redeemed
            reward.IsRedeemed = true;
            _appDbContext.Entry(reward).State = EntityState.Modified;
            await _appDbContext.SaveChangesAsync();

            return Ok(new { Status = "Success", Message = "Reward redeemed successfully!" });
        }
        catch (Exception)
        {
            return BadRequest("An error occurred while redeeming the reward.");
        }
    }

    [HttpPost]
    [Route("setReward")]
    public async Task<IActionResult> SetReward(RewardSetViewModel r)
    {
        try
        {
            var reward = new Reward
            {
                Reward_Issue_Date = r.Reward_Issue_Date,
                Reward_Type_ID = r.Reward_Type_ID,
                IsPosted = r.IsPosted
            };
            _appDbContext.Rewards.Add(reward);
            await _appDbContext.SaveChangesAsync();

            return CreatedAtAction(nameof(GetRewardById), new { id = reward.Reward_ID }, reward);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpPost]
    [Route("postReward")]
    public async Task<IActionResult> PostReward([FromBody] RewardPostViewModel request)
    {
        try
        {
            // Fetch the reward by ID
            var reward = await _appDbContext.Rewards
                                            .FirstOrDefaultAsync(r => r.Reward_ID == request.RewardId);

            if (reward == null)
            {
                return NotFound("Reward not found.");
            }

            // Check if the reward is already posted
            if (reward.IsPosted)
            {
                return BadRequest("Reward is already posted.");
            }

            // Mark the reward as posted
            reward.IsPosted = true;
            _appDbContext.Entry(reward).State = EntityState.Modified;
            await _appDbContext.SaveChangesAsync();

            return Ok(new { Status = "Success", Message = "Reward posted successfully!" });
        }
        catch (Exception)
        {
            return BadRequest("An error occurred while posting the reward.");
        }
    }
}

//AppDbContext
var Rewards = new Reward[]
{
    new Reward { Reward_ID = 1, IsPosted = false, Reward_Issue_Date = new DateTime(2024, 4, 10), Reward_Type_ID = 1 }

};
builder.Entity<Reward>().HasData(Rewards);

var Reward_Members = new Reward_Member[]
{
    new Reward_Member{ Reward_Member_ID = 1, IsRedeemed = false, Member_ID = 1, Reward_ID = 1}
};
builder.Entity<Reward_Member>().HasData(Reward_Members);
var jwt = require('jsonwebtoken');
const userModel = require('../model/user');

function Auth (req, res, next) {

    const getUserCookies = req.cookies.userData;

    if(!getUserCookies){
        res.status(200).json({message: 'Login First'})
    }

    jwt.verify(getUserCookies.token, 'shhhhh', async function(err, decoded) {
        req.user = await userModel.findById(decoded._id);
        if (!req.user) {
            return res.status(401).json({ error: 'Invalid token. User not found.' });
          }
        next() // bar
    });
}

module.exports = Auth;


const mongoose = require('mongoose');

const userSchema = new mongoose.Schema({
   
    email:{
        type: 'string',
        required: true
    },
    password:{
        type: 'string',
        required: true
    }

  });

  const userModel = mongoose.model('User', userSchema);

  module.exports = userModel;


var express = require('express');
var router = express.Router();
const userModel = require('../model/user');
var jwt = require('jsonwebtoken');
const Auth = require('../middleware/Auth');

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});

const createUser = async (req,res,nexr) => {

  try {
    
    const userDatasave = new userModel({
      email: req.body.email,
      password: req.body.password
    })

    const saveUser = await userDatasave.save();

    res.status(200).json({
      status: 'success',
      saveUser: saveUser
    })

  } catch (error) {

    console.log(error.message);

    res.status(500).json({
      status: 'Server Error',
    })
    
  }

}

const checkUser = async (req,res,nexr) => {

  try {
    
    const {email, password} = req.body;
    const findUser = await userModel.findOne({email})

    if(findUser){

      if(findUser.password === password){

        var token = jwt.sign({ _id: findUser._id }, 'shhhhh', { expiresIn: '1h'});
        res.cookie('userData',{...findUser,token},{httpOnly: true});
        res.status(200).json({
          status: 'login successful',
          token
        })

      }else{

        res.status(200).json({
          status: 'Wrong Password',
        })

      }

    }else{

      res.status(200).json({
        status: 'User not Found',
      })

    }

  } catch (error) {

    console.log(error.message);

    res.status(500).json({
      status: 'Server Error',
    })
    
  }

}

const getAllUser = async (req,res,nexr) => {

  try {
    const findUser = await userModel.find({})

    res.status(200).json({
      status: 'success',
      findUser: findUser
    })

  } catch (error) {

    console.log(error.message);

    res.status(500).json({
      status: 'Server Error',
    })
    
  }

}

const userLogout = async (req,res,nexr) => {

  try {
    res.clearCookie('userData');

    res.status(200).json({
      status: 'user logged out successfully',
    })

  } catch (error) {

    console.log(error.message);

    res.status(500).json({
      status: 'Server Error',
    })
    
  }

}


router.post('/saveuser',createUser);
router.post('/loginuser',checkUser);
router.get('/getuser',Auth,getAllUser);
router.get('/logout',Auth,userLogout);


module.exports = router;


//Models
//Reward
public class Reward
{
    [Key]

    public int Reward_ID { get; set; }

    [Required]
    public string Prize { get; set; }

    [Required]
    public DateTime Reward_Issue_Date { get; set; }

    public int Member_ID { get; set; }

    [ForeignKey(nameof(Member_ID))]
    public Member Member { get; set; }

    
    public int Reward_Type_ID { get; set; }


    [ForeignKey(nameof(Reward_Type_ID))]
    public Reward_Type Reward_Type { get; set; }


    public bool IsRedeemed { get; set; } // New property to track redemption status
}

//RewardType
public class Reward_Type
{
    [Key]
    public int Reward_Type_ID { get; set; }

    [Required]
    public string Reward_Type_Name { get; set; }

    [Required]
    public string Reward_Criteria { get; set; }
}

//Reward_Member
public class Reward_Member
{
    [Key]
    public int Reward_Member_ID { get; set; }

    public int Number_Of_Qualified_Members { get; set; }

    public int Member_ID { get; set; }

    [ForeignKey(nameof(Member_ID))]

    public Member Member { get; set; }


    public int Reward_ID { get; set; }

    [ForeignKey(nameof(Reward_ID))]

    public Reward Reward { get; set; }
}

//ViewModels
//RewardViewModel
public class RewardViewModel
{
    public int MemberId { get; set; }
    public int RewardId { get; set; }
}

//AppDbContext
//Reward Seed Data
var Rewards = new Reward[]
{
    new Reward { Reward_ID = 1, Prize = "Free Gym Membership", Reward_Issue_Date = new DateTime(2024, 4, 10), Member_ID = 1, Reward_Type_ID = 1 }

};
builder.Entity<Reward>().HasData(Rewards);


//Reward_Member Seed Data
var Reward_Members = new Reward_Member[]
{
    new Reward_Member{ Reward_Member_ID = 1,Number_Of_Qualified_Members = 3,Member_ID = 1, Reward_ID = 1}
};
builder.Entity<Reward_Member>().HasData(Reward_Members);

//Controller
[Route("api/[controller]")]
[ApiController]
public class RewardController : ControllerBase
{
    private readonly AppDbContext _appDbContext;

    public RewardController(AppDbContext appDbContext)
    {
        _appDbContext = appDbContext;
    }

    [HttpPost]
    [Route("createRewardType")]
    public async Task<IActionResult> CreateRewardType(RewardTypeViewModel rt)
    {
        try
        {
            var rewardType = new Reward_Type
            {
                Reward_Type_Name = rt.Reward_Type_Name,
                Reward_Criteria = rt.Reward_Criteria
                
            };
            _appDbContext.Reward_Types.Add(rewardType);
            await _appDbContext.SaveChangesAsync();

            return CreatedAtAction(nameof(GetRewardTypeById), new { id = rewardType.Reward_Type_ID }, rewardType);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpGet]
    [Route("getAllRewardTypes")]
    public async Task<IActionResult> GetAllRewardTypes()
    {
        try
        {
            var rewardTypes = await _appDbContext.Reward_Types.ToListAsync();
            return Ok(rewardTypes);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpGet]
    [Route("getRewardTypeById/{id}")]
    public async Task<IActionResult> GetRewardTypeById(int id)
    {
        try
        {
            var rewardType = await _appDbContext.Reward_Types.FindAsync(id);

            if (rewardType == null)
            {
                return NotFound();
            }

            return Ok(rewardType);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpPut]
    [Route("updateRewardType/{id}")]
    public async Task<IActionResult> UpdateRewardType(int id, [FromBody] RewardTypeViewModel rt)
    {
        try
        {
            var rewardType = await _appDbContext.Reward_Types.FindAsync(id);

            if(rewardType == null)
            {
                return NotFound();
            }

            //rewardType = new Reward_Type
            //{
            //    Reward_Type_Name = rt.Reward_Type_Name,
            //    Reward_Criteria = rt.Reward_Criteria
            //};

            rewardType.Reward_Type_Name = rt.Reward_Type_Name;
            rewardType.Reward_Criteria = rt.Reward_Criteria;

            _appDbContext.Entry(rewardType).State = EntityState.Modified;
            await _appDbContext.SaveChangesAsync();

            return NoContent();
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpDelete]
    [Route("deleteRewardType/{id}")]
    public async Task<IActionResult> DeleteRewardType(int id)
    {
        try
        {
            var rewardType = await _appDbContext.Reward_Types.FindAsync(id);

            if(rewardType == null)
            {
                return NotFound();
            }

            _appDbContext.Reward_Types.Remove(rewardType);
            await _appDbContext.SaveChangesAsync();

            return NoContent();
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }



    [HttpPost]
    [Route("redeemReward")]
    public async Task<IActionResult> RedeemReward([FromBody] RewardViewModel request)
    {
        try
        {
            // Fetch the reward by ID
            var reward = await _appDbContext.Rewards
                                            .FirstOrDefaultAsync(r => r.Reward_ID == request.RewardId && r.Member_ID == request.MemberId);

            if (reward == null)
            {
                return NotFound("Reward not found or not eligible for the member.");
            }

            // Check if the reward is already redeemed
            if (reward.IsRedeemed)
            {
                return BadRequest("Reward is already redeemed.");
            }

            // Mark the reward as redeemed
            reward.IsRedeemed = true;
            _appDbContext.Entry(reward).State = EntityState.Modified;
            await _appDbContext.SaveChangesAsync();

            return Ok(new { Status = "Success", Message = "Reward redeemed successfully!" });
        }
        catch (Exception)
        {
            return BadRequest("An error occurred while redeeming the reward.");
        }
    }

    [HttpPost]
    [Route("setReward")]
    public async Task<IActionResult> SetReward(Reward r)
    {
        try
        {
            var reward = new Reward
            {
                Prize = r.Prize,
                Reward_Issue_Date = r.Reward_Issue_Date,
                Member_ID = r.Member_ID,
                Reward_Type_ID = r.Reward_Type_ID
            };
            _appDbContext.Rewards.Add(reward);
            await _appDbContext.SaveChangesAsync();

            return CreatedAtAction(nameof(GetRewardById), new { id = reward.Reward_ID }, reward);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpGet]
    [Route("getRewardById/{id}")]
    public async Task<IActionResult> GetRewardById(int id)
    {
        try
        {
            var reward = await _appDbContext.Reward_Types.FindAsync(id);

            if (reward == null)
            {
                return NotFound();
            }

            return Ok(reward);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }

    [HttpGet]
    [Route("getAllRewards")]
    public async Task<IActionResult> GetAllRewards()
    {
        try
        {
            var rewards = await _appDbContext.Rewards.ToListAsync();
            return Ok(rewards);
        }
        catch (Exception)
        {
            return BadRequest();
        }
    }
}
--> Collection(model)-->user.js --> userDetails.js
const mongoose = require('mongoose');

function validateEmail(email) {
    const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
    return emailRegex.test(email);
  }

const userModel = new mongoose.Schema({
    email:{
        type:String,
        require: true,
        unique: true,
        validate: {
            validator: validateEmail,
            message: 'Invalid email format',
        },
    },
    password:{
        type:String,
        require: true
    },
},
{
    timestamps: true
}
);

const userDataModel = mongoose.model('user', userModel);

module.exports = userDataModel;


const mongoose = require('mongoose');

const DetailModel = new mongoose.Schema({

    user_id:{
        type: mongoose.Schema.Types.ObjectId,
        ref:'user',
        required: true,
    },
    name:{
        type:String,
        require: true,
        validate: {
            validator: function(value) {
              const regex = /^[a-zA-Z]+$/;
              return regex.test(value);
            },
            message: 'Invalid characters in the name field. Only alphabets are allowed.'
          }
    },
    phone:{
        type:Number,
        require: true
    },
    country:{
        type:String,
        enum: ['USA', 'Canada', 'UK', 'Australia', 'India', 'Other'],
        require: true
    },
    additional_info:{
        type:String,
        require: true,
        validate: {
            validator: function(value) {
              const regex = /^[a-zA-Z0-9.,@_]+$/;
              return regex.test(value);
            },
            message: 'Invalid characters in additional_info field.'
          }
    },
    file:{
        type:String,
        required: true
    }
},
{
    timestamps: true
}
);

const userDetailModel = mongoose.model('userDetail', DetailModel);

module.exports = userDetailModel;





-->router --> user.js

var express = require('express');
var router = express.Router();
const multer = require('multer');
const fs = require('fs')
const path = require('path');
const userDataModel = require('../collection/user')
const userDetailModel = require('../collection/userDetail')

const storage = multer.diskStorage({
  destination: (req, file, cb) => {
    cb(null, 'uploads/');
  },
  filename: (req, file, cb) => {
    cb(null, `${Date.now()}_${file.originalname}`); 
  },
});

const fileFilter = (req, file, cb) => {
  const allowedMimes = ['application/pdf'];
  if (allowedMimes.includes(file.mimetype)) {
    cb(null, true);
  } else {
    cb(new Error('Invalid file type. Only PDF files are allowed.'));
  }
};

const upload = multer({
  storage: storage,
  limits: {
    fileSize: 50 * 1024 * 1024,
  },
  fileFilter: fileFilter,
});


const userRegister = async (req, res,next) => {

  try {

    const registerUser = new userDataModel({
      email: req.body.email,
      password: req.body.password,
    })

    const saveUser = await registerUser.save();

    const userid = saveUser._id;

    const userDetail = new userDetailModel({
      user_id: userid,
      name: req.body.name,
      phone: req.body.phone,
      country: req.body.country,
      additional_info: req.body.additional_info,
      file: req.file.filename,
    })

    const saveUserDetail = await userDetail.save();

    res.status(200).json({
      status:"Success",
      saveUser,
      saveUserDetail,
    })

    
  } catch (error) {
    fs.unlinkSync(req.file.path);
    if (error.name === 'ValidationError') {
      fs.unlinkSync(req.file.path);
      const validationErrors = {};
      for (const key in error.errors) {
        validationErrors[key] = error.errors[key].message;
      }
      return res.status(400).json({ errors: validationErrors });
    }
    console.error(error);
    res.status(500).send('Internal Server Error'); 
  }

}

const userList = async (req, res,next) => {

  try {

      const query = {};
      if (req.query.email) {
        query.email = { $regex: new RegExp(req.query.email, 'i') };
      }
      if (req.query.name) {
        query.name = { $regex: new RegExp(req.query.name, 'i') };
      }
      if (req.query.phone) {
        query.phone = req.query.phone;
      }
      if (req.query.country) {
        query.country = { $regex: new RegExp(req.query.country, 'i') };
      }

        const page = parseInt(req.query.page) || 1;
        const pageSize = parseInt(req.query.pageSize) || 5;

        
        const userDetails = await userDetailModel.aggregate([
          {
            $match: query,
          },
          {
            $lookup: {
              from: 'users',
              localField: 'user_id',
              foreignField: '_id',
              as: 'user',
            },
          },
          // {
          //   $unwind: '$user',
          // },
          {
            $skip: (page - 1) * pageSize,
          },
          {
            $limit: pageSize,
          },
        ]);

        res.json(userDetails);
      
  } catch (error) {
      res.status(500).send('Internal Server Error');
  }

}

const updateUser = async (req, res, next) => {
  try {
    const userId = req.params.id;

    const existingUserDetail = await userDetailModel.findOne({ user_id: userId });

    if (existingUserDetail && existingUserDetail.file) {
      const filePath = path.join('uploads/', existingUserDetail.file);
      fs.unlinkSync(filePath);
    }

    const updateUserData = await userDataModel.findByIdAndUpdate(
      userId,
      {
        email: req.body.email,
        password: req.body.password,
      },
      { new: true }
    );

    if(updateUserData === null){
      res.status(200).json({
        status: 'User Not Found',
      });
    }

    const updateUserDetail = await userDetailModel.findOneAndUpdate(
      { user_id: userId },
      {
        name: req.body.name,
        phone: req.body.phone,
        country: req.body.country,
        additional_info: req.body.additional_info,
        file: req.file.filename,
      },
      { new: true }
    );

    res.status(200).json({
      status: 'Success',
      updateUserData,
      updateUserDetail,
    });
  } catch (error) {
    fs.unlinkSync(req.file.path);
    if (error.name === 'ValidationError') {
      fs.unlinkSync(req.file.path);
      const validationErrors = {};
      for (const key in error.errors) {
        validationErrors[key] = error.errors[key].message;
      }
      return res.status(400).json({ errors: validationErrors });
    }
    console.error(error);
    res.status(500).send('Internal Server Error');
  }
};

const deleteUser = async (req, res, next) => {
  try {

    const userId = req.params.id;

    const deleteUser = await userDataModel.findByIdAndDelete(userId);

    if (!deleteUser) {
      return res.status(404).json({ status: 'Error', message: 'User not found' });
    }

    const deleteUserDetail =   userDetailModel.findOneAndDelete({ user_id: userId });

    if (deleteUserDetail.file) {
      const filePath = path.join('uploads/', deleteUserDetail.file);
      fs.unlinkSync(filePath);
    }

    res.status(200).json({
      status: 'Success',
      message: 'User deleted successfully',
    });
    
  } catch (error) {
    if (error.name === 'ValidationError') {
      const validationErrors = {};
      for (const key in error.errors) {
        validationErrors[key] = error.errors[key].message;
      }
      return res.status(400).json({ errors: validationErrors });
    }
    console.error(error);
    res.status(500).send('Internal Server Error');
  }
};

router.post("/addUser",upload.single('file'), userRegister);
router.get("/userList", userList);
router.put('/updateUser/:id', upload.single('file'), updateUser);
router.delete('/deleteUser/:id', deleteUser);


module.exports = router;


//middleware --> auth
const jwt = require('jsonwebtoken');

function Auth (req, res, next) {

    const token = req.session.token || req.cookies.token;

    if (!token) {
        return res.status(401).send({ error: 'Unauthorized' });
    }

    try {

        const payload = jwt.verify(token, "JWT_SECRET");
        req.user = payload;
        next();
        
    } catch (error) {
        res.status(401).send({ error: 'Unauthorized' });
    }

}

module.exports = Auth;



--> model --> user.js
const mongoose = require('mongoose');
const bcrypt = require('bcrypt');

const userSchema = new mongoose.Schema({
    username: 
    {
        type: 'String'
    },
    password:{
        type: 'String'
    }
  });

  userSchema.pre('save',async function (next){

    if(this.isModified('password')){
        this.password = await bcrypt.hash(this.password, 10);
    }
    next();
  })

  const userModel = mongoose.model('User', userSchema);

  module.exports = userModel;
  
  
  
  -->router --> user.js
  var express = require('express');
var router = express.Router();
var userModel = require('../model/user');
const auth = require('../middleware/auth');
const jwt = require('jsonwebtoken');
const bcrypt = require('bcrypt');
/* GET users listing. */

const CreateUser =  async (req,res,next) => {

    try {

       const createUser = new userModel({
        username: req.body.username,
        password: req.body.password
       })

       const saveData = await createUser.save();

       res.status(200).json({
        status: 'success',
        saveData
       })

      
    } catch (error) {

      res.status(500).json({
        status: 'error',
        error
      })
      
    }

}

const CheckUser = async (req,res,next) => {

  try {

    const {username , password } = req.body

    const findUser = await userModel.findOne({ username : username})

    if(findUser){

      bcrypt.compare(password, findUser.password, function(err, result) {
        // result == true
        if (result == true) {

          console.log(findUser);

          const token = jwt.sign({ _id: findUser._id }, "JWT_SECRET", { expiresIn: '1h' });
      
          res.cookie('token', token, { httpOnly: true });
          req.session.user = findUser;
      
          res.status(200).json({
            status: 'Login success',
            token
           })
          
        }else {

          res.status(500).json({
            status: 'Password Incorrect',
          })

        }
      });

    }else{

      res.status(500).json({
        status: 'User not Found',
      })

    }
    
  } catch (error) {
    
    res.status(500).json({
      status: 'error',
      error
    })

  }

}

const GetUser = async (req,res,next) => {

try {

  const page = parseInt(req.query.page);
  const limit = parseInt(req.query.limit) || 10;
  const skip = (page - 1) * limit;

  const findUser = await userModel.find().skip(skip).limit(limit);

  const userToken = req.cookies.token;
  const user = req.session.user;
  console.log("🚀 ~ GetUser ~ user:", user)

  console.log(user);

  res.status(200).json({
    status: 'Login success',
    findUser,
    userToken,
    user
   })
  
} catch (error) {
  
  res.status(500).json({
    status: 'error',
    error
  })

}

}

const logoutUser = async (req,res,next) => {

  try {
  
    res.clearCookie('token');
  
    res.send({ message: 'Logged out successfully' });
    
  } catch (error) {
    
    res.status(500).json({
      status: 'error',
      error
    })
  
  }
  
  }

router.post('/signin', CreateUser);
router.post('/logIn', CheckUser);
router.get('/getUser',auth, GetUser);
router.get('/logout',auth, logoutUser);

module.exports = router;
star

Sat Jul 06 2024 06:03:06 GMT+0000 (Coordinated Universal Time)

@projectrock

star

Sat Jul 06 2024 06:01:43 GMT+0000 (Coordinated Universal Time)

@projectrock

star

Sat Jul 06 2024 05:58:44 GMT+0000 (Coordinated Universal Time)

@projectrock

star

Fri Jul 05 2024 14:39:44 GMT+0000 (Coordinated Universal Time) https://getbootstrap.com/

@Black_Shadow

star

Fri Jul 05 2024 13:29:04 GMT+0000 (Coordinated Universal Time) https://robloxs.com/

@gamersac100

star

Fri Jul 05 2024 13:23:52 GMT+0000 (Coordinated Universal Time) https://robuxz.com/

@gamersac100

star

Fri Jul 05 2024 13:23:02 GMT+0000 (Coordinated Universal Time) https://robux.com/

@gamersac100

star

Fri Jul 05 2024 13:21:49 GMT+0000 (Coordinated Universal Time) undefined

@gamersac100

star

Fri Jul 05 2024 12:21:59 GMT+0000 (Coordinated Universal Time)

@slava.soynikov

star

Fri Jul 05 2024 12:19:08 GMT+0000 (Coordinated Universal Time) https://www.tutorialesprogramacionya.com/javascriptya/nodejsya/detalleconcepto.php?punto

@Semper

star

Fri Jul 05 2024 12:19:08 GMT+0000 (Coordinated Universal Time) undefined

@Semper

star

Fri Jul 05 2024 10:07:05 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #jquery #gsap

star

Fri Jul 05 2024 09:29:21 GMT+0000 (Coordinated Universal Time) https://github.com/GoogleCloudPlatform/llm-pipeline-examples

@Spsypg

star

Fri Jul 05 2024 09:28:58 GMT+0000 (Coordinated Universal Time) https://github.com/GoogleCloudPlatform/llm-pipeline-examples

@Spsypg

star

Fri Jul 05 2024 09:28:45 GMT+0000 (Coordinated Universal Time) https://github.com/GoogleCloudPlatform/llm-pipeline-examples

@Spsypg

star

Fri Jul 05 2024 09:28:22 GMT+0000 (Coordinated Universal Time) https://github.com/GoogleCloudPlatform/llm-pipeline-examples

@Spsypg

star

Fri Jul 05 2024 09:27:49 GMT+0000 (Coordinated Universal Time) https://github.com/GoogleCloudPlatform/llm-pipeline-examples

@Spsypg

star

Fri Jul 05 2024 08:41:00 GMT+0000 (Coordinated Universal Time) https://developers.google.com/machine-learning/resources/prompt-eng

@Spsypg

star

Fri Jul 05 2024 08:40:37 GMT+0000 (Coordinated Universal Time) https://developers.google.com/machine-learning/resources/prompt-eng

@Spsypg

star

Fri Jul 05 2024 07:04:10 GMT+0000 (Coordinated Universal Time) https://maticz.com/wearable-app-development

@carolinemax

star

Fri Jul 05 2024 04:25:56 GMT+0000 (Coordinated Universal Time) https://pawno-help.ru/threads/fc-gp-arizona-rp-logi-dlja-vashego-proekta-platno.1334/#post-8043

@Asjnsvaah #sql

star

Fri Jul 05 2024 04:25:54 GMT+0000 (Coordinated Universal Time) https://pawno-help.ru/threads/fc-gp-arizona-rp-logi-dlja-vashego-proekta-platno.1334/#post-8043

@Asjnsvaah #pawn

star

Fri Jul 05 2024 01:07:34 GMT+0000 (Coordinated Universal Time) https://marcobonzanini.com/2015/03/02/mining-twitter-data-with-python-part-1/

@ozzy2410

star

Fri Jul 05 2024 00:40:42 GMT+0000 (Coordinated Universal Time)

@davidmchale #scroll #intersectionobserver #observer

star

Thu Jul 04 2024 23:50:15 GMT+0000 (Coordinated Universal Time)

@davidmchale #scroll #intersectionobserver #observer

star

Thu Jul 04 2024 22:54:17 GMT+0000 (Coordinated Universal Time) https://gunsbuyerusa.com/product/polish-tantal-ak-74-for-sale/

@ak74uforsale

star

Thu Jul 04 2024 22:47:34 GMT+0000 (Coordinated Universal Time) https://gunsbuyerusa.com/product/polish-tantal-ak-74-for-sale/

@ak74uforsale

star

Thu Jul 04 2024 22:32:36 GMT+0000 (Coordinated Universal Time)

@davidmchale #scroll #scrollposition #pageoffset

star

Thu Jul 04 2024 19:53:57 GMT+0000 (Coordinated Universal Time) https://cloud.google.com/functions/docs/console-quickstart?hl

@Spsypg #javascript

star

Thu Jul 04 2024 18:24:23 GMT+0000 (Coordinated Universal Time) https://uxkit.digital.gob.do/es/

@linconl

star

Thu Jul 04 2024 18:09:30 GMT+0000 (Coordinated Universal Time) https://uxkit.digital.gob.do/es/

@linconl

star

Thu Jul 04 2024 18:08:53 GMT+0000 (Coordinated Universal Time)

@sunnywhateverr

star

Thu Jul 04 2024 18:08:19 GMT+0000 (Coordinated Universal Time)

@sunnywhateverr

star

Thu Jul 04 2024 17:26:06 GMT+0000 (Coordinated Universal Time)

@wasim_mm1

star

Thu Jul 04 2024 17:08:43 GMT+0000 (Coordinated Universal Time)

@imran1701

star

Thu Jul 04 2024 13:46:11 GMT+0000 (Coordinated Universal Time)

@realpygmygoat

star

Thu Jul 04 2024 10:44:12 GMT+0000 (Coordinated Universal Time) https://meyerweb.com/eric/tools/css/reset/

@WebDevSylvester #css #html

star

Thu Jul 04 2024 10:18:47 GMT+0000 (Coordinated Universal Time)

@Promakers2611

star

Thu Jul 04 2024 09:53:26 GMT+0000 (Coordinated Universal Time)

@Promakers2611

star

Thu Jul 04 2024 09:34:18 GMT+0000 (Coordinated Universal Time) https://www.pyramidions.com/mobile-app-development-chennai.html

@Steve_1

star

Thu Jul 04 2024 08:32:10 GMT+0000 (Coordinated Universal Time)

@Ranjith

star

Thu Jul 04 2024 04:18:55 GMT+0000 (Coordinated Universal Time) https://secure.helpscout.net/inboxes/a66af2abc7090990/views/4174594

@Pulak

star

Thu Jul 04 2024 01:52:08 GMT+0000 (Coordinated Universal Time)

@davidmchale #css #variables

star

Thu Jul 04 2024 01:11:04 GMT+0000 (Coordinated Universal Time)

@davidmchale #event #url #newurl

star

Wed Jul 03 2024 13:15:09 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Wed Jul 03 2024 11:52:08 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Wed Jul 03 2024 11:41:42 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Wed Jul 03 2024 11:38:23 GMT+0000 (Coordinated Universal Time)

@sid_balar

Save snippets that work with our extensions

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