Snippets Collections
// a. Working with Prototypical Inheritance and Classes
function Animal(name) {
  this.name = name;
}

Animal.prototype.speak = function () {
  console.log(`${this.name} makes a noise.`);
};

function Dog(name) {
  Animal.call(this, name);
}

Dog.prototype = Object.create(Animal.prototype);
Dog.prototype.constructor = Dog;

Dog.prototype.speak = function () {
  console.log(`${this.name} barks.`);
};

const dog1 = new Dog("Buddy");
dog1.speak(); // Output: Buddy barks.

//classes

class Animal {
  constructor(name) {
    this.name = name;
  }
  speak() {
    console.log(`${this.name} makes a noise.`);
  }
}

class Dog extends Animal {
  speak() {
    console.log(`${this.name} barks.`);
  }
}

const dog2 = new Dog("Max");
dog2.speak(); // Output: Max barks.

 
// b. Working with Object and Array Destructuring
const user = { name: 'Alice', age: 25, location: 'New York' };
const { name, age } = user;
console.log(`${name} is ${age} years old.`);
 
const numbers = [1, 2, 3, 4, 5];
const [first, second, ...rest] = numbers;
console.log(`First: ${first}, Second: ${second}, Rest: ${rest}`);
 
// c. Working with Modules
// In another file (mathUtils.js), create:
// export function add(a, b) { return a + b; }
// export function multiply(a, b) { return a * b; }
// Then import and use in this file:
// import { add, multiply } from './mathUtils.js';
 
// d. Working with Function Generators and Symbols
function* numberGenerator() {
    let num = 1;
    while (true) {
        yield num++;
    }
}
const gen = numberGenerator();
console.log(gen.next().value); // 1
console.log(gen.next().value); // 2
 
const uniqueID = Symbol('id');
const obj = { [uniqueID]: 12345 };
console.log(obj[uniqueID]);
 
// e. Working with Closures
function outerFunction() {
  let count = 0;

  function innerFunction() {
    count++;
    console.log(count);
  }

  return innerFunction;
}

const counter = outerFunction();
counter(); // 1
counter(); // 2
counter(); // 3
npm init -y
npm install express jsonwebtoken
npm init -y
npm install express mongoose jsonwebtoken bcryptjs dotenv
const express = require('express');
const jwt = require('jsonwebtoken');
const bcrypt = require('bcryptjs');
const User = require('../models/User');
const router = express.Router();

function verifyToken(req, res, next) {
    const token = req.headers['authorization'];
    if (!token) return res.status(403).send('No token provided');
    jwt.verify(token, process.env.JWT_SECRET, (err, decoded) => {
        if (err) return res.status(401).send('Invalid token');
        req.userId = decoded.id;
        next();
    });
}

router.post('/register', async (req, res) => {
    const hashedPassword = await bcrypt.hash(req.body.password, 8);
    const user = new User({ ...req.body, password: hashedPassword });
    await user.save();
    res.send('User registered');
});

router.post('/login', async (req, res) => {
    const user = await User.findOne({ email: req.body.email });
    if (!user) return res.status(404).send('User not found');

    const valid = await bcrypt.compare(req.body.password, user.password);
    if (!valid) return res.status(401).send('Wrong password');

    const token = jwt.sign({ id: user._id }, process.env.JWT_SECRET, { expiresIn: '1h' });
    res.send({ token });
});

router.get('/dashboard', verifyToken, async (req, res) => {
    const user = await User.findById(req.userId, { password: 0 });
    res.send(user);
});

module.exports = router;
const mongoose = require('mongoose');

const userSchema = new mongoose.Schema({
    name: String,
    email: String,
    password: String
});

module.exports = mongoose.model('User', userSchema);
const express = require('express');
const mongoose = require('mongoose');
const userRoutes = require('./routes/userRoutes');
require('dotenv').config();

const app = express();
app.use(express.json());

mongoose.connect(process.env.MONGO_URI, {
    useNewUrlParser: true,
    useUnifiedTopology: true
}).then(() => console.log("MongoDB connected"));

app.use('/api', userRoutes);

app.listen(5000, () => console.log('MongoDB Auth server running at http://localhost:5000'));
const express = require('express');
const authRoutes = require('./routes/authRoutes');

const app = express();
app.use(express.json());
app.use('/api', authRoutes);

app.listen(3000, () => console.log('Auth server running at http://localhost:3000'));
const express = require('express');
const jwt = require('jsonwebtoken');
const router = express.Router();

const users = [];

router.post('/register', (req, res) => {
    const user = req.body;
    users.push(user);
    res.send({ message: 'User registered' });
});

router.post('/login', (req, res) => {
    const { username, password } = req.body;
    const user = users.find(u => u.username === username && u.password === password);
    if (!user) return res.status(401).send('Invalid credentials');

    const token = jwt.sign({ username }, 'secretkey', { expiresIn: '1h' });
    res.send({ token });
});

router.get('/profile', verifyToken, (req, res) => {
    res.send({ message: 'Welcome to your profile!', user: req.user });
});

function verifyToken(req, res, next) {
    const token = req.headers['authorization'];
    if (!token) return res.status(403).send('No token provided');
    jwt.verify(token, 'secretkey', (err, decoded) => {
        if (err) return res.status(401).send('Invalid token');
        req.user = decoded;
        next();
    });
}

module.exports = router;
<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
  <h3>Temperature Forecast Chart</h3>
  <input id="city" placeholder="Enter city">
  <button onclick="drawChart()">Get Forecast</button>
  <canvas id="tempChart" width="400" height="200"></canvas>

  <script>
    async function drawChart() {
      const city = document.getElementById("city").value;
      const key = "36f9af4e269fe80b4cda0e7e8af0809d"; // Replace with your OpenWeatherMap API key
      const res = await fetch(`https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${key}&units=metric`);
      const data = await res.json();

      const labels = [];
      const temps = [];

      data.list.forEach((item, i) => {
        if (i % 8 === 0) { // every 24 hours (8 x 3-hour slots)
          labels.push(item.dt_txt.split(" ")[0]);
          temps.push(item.main.temp);
        }
      });

      new Chart(document.getElementById("tempChart"), {
        type: 'bar',
        data: {
          labels: labels,
          datasets: [{
            label: 'Temperature (°C)',
            data: temps,
            backgroundColor: 'rgba(54, 162, 235, 0.6)'
          }]
        },
        options: {
          scales: {
            y: {
              beginAtZero: true
            }
          }
        }
      });
    }
  </script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
  <title>Weather Forecast</title>
</head>
<body>
  <h2>5-Day Forecast</h2>
  <input type="text" id="forecastCity" placeholder="Enter city name">
  <button onclick="getForecast()">Get Forecast</button>

  <table border="1" id="forecastTable">
    <tr><th>Date</th><th>Temperature (°C)</th></tr>
  </table>

  <script>
    async function getForecast() {
      const city = document.getElementById('forecastCity').value;
      const apiKey = '36f9af4e269fe80b4cda0e7e8af0809d';  // Replace with your OpenWeatherMap API key
      const url = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=metric`;

      const response = await fetch(url);
      const data = await response.json();

      const table = document.getElementById("forecastTable");
      table.innerHTML = `<tr><th>Date</th><th>Temperature (°C)</th></tr>`; // clear old rows

      data.list.forEach((item, index) => {
        if (index % 8 === 0) { // every 8th item = 24 hours
          const row = table.insertRow();
          row.innerHTML = `<td>${item.dt_txt.split(" ")[0]}</td>
                           <td>${item.main.temp}°C</td>`;
        }
      });
    }
  </script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
  <title>Weather Data</title>
</head>
<body>
  <h2>Weather Info</h2>
  <input type="text" id="city" placeholder="Enter city name">
  <button onclick="getWeather()">Get Weather</button>

  <table border="1" id="weatherTable">
    <tr><th>City</th><th>Min Temp</th><th>Max Temp</th><th>Humidity</th></tr>
  </table>

  
        <script>
  async function getWeather() {
    const city = document.getElementById('city').value.trim();
    const apiKey = '36f9af4e269fe80b4cda0e7e8af0809d'; // Make sure this is valid

    if (!city) {
      alert("Please enter a city name.");
      return;
    }

    const url = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`;

    try {
      const response = await fetch(url);
      const data = await response.json();
      if (response.ok) {
        const table = document.getElementById("weatherTable");
        const row = table.insertRow();
        row.innerHTML = `<td>${data.name}</td>
                         <td>${data.main.temp_min}°C</td>
                         <td>${data.main.temp_max}°C</td>
                         <td>${data.main.humidity}%</td>`;
      } else {
        alert(`Error: ${data.message}`);
      }
    } catch (error) {
      alert("Failed to fetch weather data. Please try again later.");
      console.error(error);
    }
  }
</script>

</body>
</html>
<!DOCTYPE html>
<html>
<head>
  <title>Fetch Example</title>
</head>
<body>
  <h2>User Data</h2>
  <table border="1" id="dataTable">
    <tr>
      <th>Name</th>
      <th>Email</th>
    </tr>
  </table>

  <script>
    fetch('https://jsonplaceholder.typicode.com/users')
      .then(response => response.json())
      .then(data => {
        const table = document.getElementById("dataTable");
        data.forEach(user => {
          const row = table.insertRow();
          row.innerHTML = `<td>${user.name}</td><td>${user.email}</td>`;
        });
      })
      .catch(err => console.log("Error:", err));
  </script>
</body>
</html>
const express = require('express');
const app = express();

app.get('/', (req, res) => {
    res.send('Welcome to Express Server');
});

app.get('/html', (req, res) => {
    res.send('<h1>Hello from Express</h1>');
});

app.get('/json', (req, res) => {
    res.json({ message: 'Hello, Express!' });
});

app.listen(3000, () => {
    console.log('Express server running at http://localhost:3000/');
});
const http = require('http');
 
const server = http.createServer((req, res) => {
    if (req.url === '/html') {
        res.writeHead(200, { 'Content-Type': 'text/html' });
        res.end('<h1>Hello, World! i am jashwanth reddy</h1>');
    } else if (req.url === '/json') {
        res.writeHead(200, { 'Content-Type': 'application/json' });
        res.end(JSON.stringify({ message: 'Hello, World! this is jashwanth' }));
    } else {
        res.writeHead(200, { 'Content-Type': 'text/plain' });
        res.end('Hello, World!');
    }
});
 
server.listen(3000, () => {
    console.log('Server running at http://localhost:3000/');
});
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const PORT = 3000;

app.use(bodyParser.json());

let users = [
    { id: 1, name: "Alice", email: "alice@example.com" },
    { id: 2, name: "Bob", email: "bob@example.com" }
];

// CREATE
app.post('/users', (req, res) => {
    const user = req.body;
    user.id = users.length + 1;
    users.push(user);
    res.status(201).send(user);
});

// READ all users
app.get('/users', (req, res) => {
    res.send(users);
});

// READ single user
app.get('/users/:id', (req, res) => {
    const user = users.find(u => u.id == req.params.id);
    res.send(user || {});
});

// UPDATE
app.put('/users/:id', (req, res) => {
    const id = req.params.id;
    const index = users.findIndex(u => u.id == id);
    if (index !== -1) {
        users[index] = { ...users[index], ...req.body };
        res.send(users);
    } else {
        res.status(404).send({ error: "User not found" });
    }
});

// DELETE
app.delete('/users/:id', (req, res) => {
    const id = req.params.id;
    users = users.filter(u => u.id != id);
    res.send({ message: "User deleted" });
});

app.listen(PORT, () => {
    console.log(`Server running on http://localhost:${PORT}`);
});
const express = require('express');
const axios = require('axios');
const app = express();

app.set('view engine', 'ejs');

app.get('/', async (req, res) => {
    const response = await axios.get('https://jsonplaceholder.typicode.com/users');
    res.render('users', { users: response.data });
});

app.listen(3000, () => {
    console.log('Server running at http://localhost:3000');
});
<!DOCTYPE html>
<html>
<head>
    <title>Users</title>
</head>
<body>
    <h1>User List</h1>
    <table border="1" cellpadding="5">
        <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Email</th>
        </tr>
        <% users.forEach(user => { %>
            <tr>
                <td><%= user.id %></td>
                <td><%= user.name %></td>
                <td><%= user.email %></td>
            </tr>
        <% }) %>
    </table>
</body>
</html>
const express = require('express');
const bodyParser = require('body-parser');
const userRoutes = require('./routes/userRoutes');
require('dotenv').config();
require('./services/firebaseService'); // Initialize Firebase

const app = express();
app.use(bodyParser.json());

app.use('/users', userRoutes);

app.listen(3000, () => {
  console.log('Firebase app running on http://localhost:3000');
});
const admin = require('firebase-admin');
const serviceAccount = require('../firebase-key.json'); // adjust path
require('dotenv').config(); // Make sure this line is included

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: process.env.FIREBASE_DB_URL // This must not be undefined
});

const db = admin.database();
const ref = db.ref('users');

module.exports = ref;
const express = require('express');
const router = express.Router();
const usersRef = require('../services/firebaseService');

// Add user
router.post('/', (req, res) => {
  const newUser = usersRef.push();
  newUser.set(req.body);
  res.send({ message: 'User added', id: newUser.key });
});

// Get users
router.get('/', (req, res) => {
  usersRef.once('value', snapshot => {
    res.send(snapshot.val());
  });
});

// Update user
router.put('/:id', (req, res) => {
  usersRef.child(req.params.id).update(req.body);
  res.send({ message: 'User updated' });
});

// Delete user
router.delete('/:id', (req, res) => {
  usersRef.child(req.params.id).remove();
  res.send({ message: 'User deleted' });
});

module.exports = router;
const express = require('express');
const mongoose = require('mongoose');
const bodyParser = require('body-parser');
const dotenv = require('dotenv');
const userRoutes = require('./routes/users');

dotenv.config(); // Load .env file

const app = express();
app.use(bodyParser.json());

// Connect to MongoDB using .env variable
mongoose.connect(process.env.MONGO_URI)
    .then(() => console.log("MongoDB connected"))
    .catch(err => console.log(err));

// Use user routes
app.use('/', userRoutes);

app.listen(5000, () => {
    console.log("Server started at http://localhost:5000");
});
const mongoose = require('mongoose');

const userSchema = new mongoose.Schema({
    name: String,
    email: String,
    phone: String
});

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

module.exports = User;
const express = require('express');
const router = express.Router();
const User = require('../models/User');

// CREATE
router.post('/', async (req, res) => {
    try {
        const user = new User(req.body);
        await user.save();
        res.send(user);
    } catch (err) {
        res.status(500).send({ error: err.message });
    }
});

// READ all
router.get('/', async (req, res) => {
    const users = await User.find();
    res.send(users);
});

// UPDATE
router.put('/:id', async (req, res) => {
    const user = await User.findByIdAndUpdate(req.params.id, req.body, { new: true });
    res.send(user);
});

// DELETE
router.delete('/:id', async (req, res) => {
    await User.findByIdAndDelete(req.params.id);
    res.send({ message: 'User deleted' });
});

module.exports = router;
$counters = “\ServerNameProcessor(_Total)% Processor Time”, “\ServerNameMemoryAvailable MBytes”, “\ServerNameLogicalDisk(C:)% Free Space” $interval = 5 $duration = (New–TimeSpan –Minutes 30) $path = “C:PerformanceData.csv” $samples = $duration.TotalSeconds / $interval $data = @() for ($i=1; $i –le $samples; $i++) { $sample = Get–Counter –Counter $counters –SampleInterval $interval $data += $sample.CounterSamples | Select–Object –Property Timestamp, Path, CookedValue } $data | Export–Csv –Path $path –NoTypeInformation
import React from "react";
import { Card, CardContent } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Cpu, HardDrive, Network, Cloud } from "lucide-react";

const mockStats = {
  cpu: "24%",
  ram: "3.2 GB / 8 GB",
  disk: "120 GB / 256 GB",
  network: "Down: 5 Mbps | Up: 1 Mbps",
};

export default function Dashboard() {
  return (
    <div className="min-h-screen bg-gray-900 text-white p-6 grid gap-6 grid-cols-1 md:grid-cols-2 xl:grid-cols-4">
      <Card className="bg-gray-800 rounded-2xl shadow-lg">
        <CardContent className="p-4">
          <div className="flex items-center space-x-4">
            <Cpu className="text-yellow-400 w-8 h-8" />
            <div>
              <h3 className="text-xl font-semibold">CPU Usage</h3>
              <p>{mockStats.cpu}</p>
            </div>
          </div>
        </CardContent>
      </Card>
      <Card className="bg-gray-800 rounded-2xl shadow-lg">
        <CardContent className="p-4">
          <div className="flex items-center space-x-4">
            <HardDrive className="text-green-400 w-8 h-8" />
            <div>
              <h3 className="text-xl font-semibold">RAM Usage</h3>
              <p>{mockStats.ram}</p>
            </div>
          </div>
        </CardContent>
      </Card>
      <Card className="bg-gray-800 rounded-2xl shadow-lg">
        <CardContent className="p-4">
          <div className="flex items-center space-x-4">
            <Cloud className="text-blue-400 w-8 h-8" />
            <div>
              <h3 className="text-xl font-semibold">Disk Space</h3>
              <p>{mockStats.disk}</p>
            </div>
          </div>
        </CardContent>
      </Card>
      <Card className="bg-gray-800 rounded-2xl shadow-lg">
        <CardContent className="p-4">
          <div className="flex items-center space-x-4">
            <Network className="text-pink-400 w-8 h-8" />
            <div>
              <h3 className="text-xl font-semibold">Network</h3>
              <p>{mockStats.network}</p>
            </div>
          </div>
        </CardContent>
      </Card>
      <div className="col-span-full mt-4">
        <Button className="w-full bg-indigo-600 hover:bg-indigo-700">Sync Files Now</Button>
      </div>
    </div>
  );
}
Tired of guessing when to buy or sell crypto? Our advanced algorithmic trading bot takes the stress out of trading. It runs 24/7, analyzing real-time market data to make smart trades for you – fast, accurate, and emotion-free. Whether you're a beginner or an experienced trader, this bot helps you grow your portfolio with ease. It’s fully automated, secure, and easy to use. Set it up once and let it work while you focus on other things. Join hundreds of users already seeing results with our powerful crypto trading tool.

Visitnow>> https://www.beleaftechnologies.com/crypto-algo-trading-bot-development
Whatsapp :  +91 8056786622
Email id :  business@beleaftechnologies.com
Telegram : https://telegram.me/BeleafSoftTech 
# Download attestations for a local artifact linked with an organization
$ gh attestation download example.bin -o github

# Download attestations for a local artifact linked with a repository
$ gh attestation download example.bin -R github/example

# Download attestations for an OCI image linked with an organization
$ gh attestation download oci://example.com/foo/bar:latest -o github
gh attestation download [<file-path> | oci://<image-uri>] [--owner | --repo] [flags]
//192.168.0.5/storage /media/myname/TK-Public/ cifs rw,guest,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <activeProfiles>
    <activeProfile>github</activeProfile>
  </activeProfiles>

  <profiles>
    <profile>
      <id>github</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>https://repo1.maven.org/maven2</url>
        </repository>
        <repository>
          <id>github</id>
          <url>https://maven.pkg.github.com/OWNER/REPOSITORY</url>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <servers>
    <server>
      <id>github</id>
      <username>USERNAME</username>
      <password>TOKEN</password>
    </server>
  </servers>
</settings>
<valid semver> ::= <version core>
                 | <version core> "-" <pre-release>
                 | <version core> "+" <build>
                 | <version core> "-" <pre-release> "+" <build>

<version core> ::= <major> "." <minor> "." <patch>

<major> ::= <numeric identifier>

<minor> ::= <numeric identifier>

<patch> ::= <numeric identifier>

<pre-release> ::= <dot-separated pre-release identifiers>

<dot-separated pre-release identifiers> ::= <pre-release identifier>
                                          | <pre-release identifier> "." <dot-separated pre-release identifiers>

<build> ::= <dot-separated build identifiers>

<dot-separated build identifiers> ::= <build identifier>
                                    | <build identifier> "." <dot-separated build identifiers>

<pre-release identifier> ::= <alphanumeric identifier>
                           | <numeric identifier>

<build identifier> ::= <alphanumeric identifier>
                     | <digits>

<alphanumeric identifier> ::= <non-digit>
                            | <non-digit> <identifier characters>
                            | <identifier characters> <non-digit>
                            | <identifier characters> <non-digit> <identifier characters>

<numeric identifier> ::= "0"
                       | <positive digit>
                       | <positive digit> <digits>

<identifier characters> ::= <identifier character>
                          | <identifier character> <identifier characters>

<identifier character> ::= <digit>
                         | <non-digit>

<non-digit> ::= <letter>
              | "-"

<digits> ::= <digit>
           | <digit> <digits>

<digit> ::= "0"
          | <positive digit>

<positive digit> ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

<letter> ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J"
           | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T"
           | "U" | "V" | "W" | "X" | "Y" | "Z" | "a" | "b" | "c" | "d"
           | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n"
           | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x"
           | "y" | "z"
/* M5Card Basic Dashboard - Time, Temperature, Weather */
#include <M5Cardputer.h>
#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <NTPClient.h>
#include <WiFiUdp.h>

// WiFi Credentials
const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";

// OpenWeather API
const char* apiKey = "YOUR_OPENWEATHER_API_KEY";
const char* city = "Kuala Lumpur";
String weatherURL = "http://api.openweathermap.org/data/2.5/weather?q=" + String(city) + "&appid=" + apiKey + "&units=metric";

WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "pool.ntp.org", 28800, 60000);

void setup() {
    M5Cardputer.begin();
    M5Cardputer.Display.setTextFont(2);
    M5Cardputer.Display.clear();
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
    }
    timeClient.begin();
}

void loop() {
    timeClient.update();
    M5Cardputer.Display.clear();
    M5Cardputer.Display.setCursor(10, 20);
    M5Cardputer.Display.printf("Time: %s", timeClient.getFormattedTime().c_str());

    if (WiFi.status() == WL_CONNECTED) {
        HTTPClient http;
        http.begin(weatherURL);
        int httpCode = http.GET();
        if (httpCode > 0) {
            String payload = http.getString();
            DynamicJsonDocument doc(1024);
            deserializeJson(doc, payload);
            float temp = doc["main"]["temp"];
            String weather = doc["weather"][0]["description"];
            M5Cardputer.Display.setCursor(10, 50);
            M5Cardputer.Display.printf("Temp: %.1f C", temp);
            M5Cardputer.Display.setCursor(10, 80);
            M5Cardputer.Display.printf("Weather: %s", weather.c_str());
        }
        http.end();
    }
    delay(10000);
}
/* M5Card Basic Dashboard - Time, Temperature, Weather */
#include <M5Cardputer.h>
#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <NTPClient.h>
#include <WiFiUdp.h>

// WiFi Credentials
const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";

// OpenWeather API
const char* apiKey = "YOUR_OPENWEATHER_API_KEY";
const char* city = "Kuala Lumpur";
String weatherURL = "http://api.openweathermap.org/data/2.5/weather?q=" + String(city) + "&appid=" + apiKey + "&units=metric";

WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "pool.ntp.org", 28800, 60000);

void setup() {
    M5Cardputer.begin();
    M5Cardputer.Display.setTextFont(2);
    M5Cardputer.Display.clear();
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
    }
    timeClient.begin();
}

void loop() {
    timeClient.update();
    M5Cardputer.Display.clear();
    M5Cardputer.Display.setCursor(10, 20);
    M5Cardputer.Display.printf("Time: %s", timeClient.getFormattedTime().c_str());

    if (WiFi.status() == WL_CONNECTED) {
        HTTPClient http;
        http.begin(weatherURL);
        int httpCode = http.GET();
        if (httpCode > 0) {
            String payload = http.getString();
            DynamicJsonDocument doc(1024);
            deserializeJson(doc, payload);
            float temp = doc["main"]["temp"];
            String weather = doc["weather"][0]["description"];
            M5Cardputer.Display.setCursor(10, 50);
            M5Cardputer.Display.printf("Temp: %.1f C", temp);
            M5Cardputer.Display.setCursor(10, 80);
            M5Cardputer.Display.printf("Weather: %s", weather.c_str());
        }
        http.end();
    }
    delay(10000);
}
try 
{
	newAccessTokenResp = invokeurl
	[
		url :"https://accounts.zoho.com/oauth/v2/token?refresh_token=1000.4dbfd6f3f7f126438dfb3401fd8dd576.4a3dede786ffa5cb2eb17686172b500e&client_id=1000.SYSU4K6QTILBGIZXBYI9MP7B1SBXYD&client_secret=9397985b78e1b9d2ddd6d3bd39f2da147fbe278489&redirect_uri=https://accounts.zohoportal.com/accounts/extoauth/clientcallback&grant_type=refresh_token"
		type :POST
	];
	newAccessToken = newAccessTokenResp.get("access_token");
	O_AuthToken = Map();
	O_AuthToken.put("Authorization","Zoho-oauthtoken " + newAccessToken + "");
	//info O_AuthToken;
	/////Get latest Employee ID FROM Zoho People///////
	People_Rec_ID = 448415000045594312;
	get_Data = zoho.people.getRecordByID("Latest_Employee_ID_Employee_Users",People_Rec_ID);
	//info get_Data;
	get_latatest_emp_id = get_Data.get("Latest_Employee_ID");
	info "latest employee id: " + get_latatest_emp_id;
	//////////
	///////////
	//////
	get_data = invokeurl
	[
		url :"https://recruit.zoho.com/recruit/v2/Candidates/" + rec_id + ""
		type :GET
		headers:O_AuthToken
	];
	//info get_data;
	data = get_data.get("data");
	for each  data in data
	{
		//info data;
		Candidate_Status = data.get("Candidate_Status");
		//info Candidate_Status;
		if(Candidate_Status == "Hired")
		{
			First_name = data.get("FirstName");
			//info First_name;
			Last_Name = data.get("LastName");
			//info Last_Name;
			////////////
			////////
			department = data.get("Employee_Department").get("id");
			//info department;
			/////
			//////////
			get_department_data = invokeurl
			[
				url :"https://recruit.zoho.com/recruit/v2/Departments/" + department + ""
				type :GET
				headers:O_AuthToken
			];
			//info get_department_data;
			dep_data = get_department_data.get("data");
			//info "Department Data RECRUIT" + dep_data;
			for each  rec in dep_data
			{
				zoho_people_dep_id = rec.get("Zoho_People_Rec_ID");
				//info zoho_people_dep_id;
			}
			///////
			//////
			//info Employee_id;
			Street = data.get("Street");
			City = data.get("City");
			State = data.get("State");
			Country = data.get("Country");
			Mobile = data.get("Mobile");
			address = Street + " " + City + " " + State + " " + Country;
			//info address;
			//Secondary_Email = data.get("Secondary_Email");
			Department = data.get("Employee_Department").get("name");
			////prob
			//info Department;
			Employee_Seating_Location = data.get("Employee_Seating_Location");
			//info Employee_Seating_Location;
			Title_Designation = data.get("Employee_Designation_Title");
			//info Title_Designation;
			Client_Type = ifnull(data.get("Client_Type"),"");
			if(Client_Type == "External")
			{
				Client_Name = ifnull(data.get("Client_Name"),"");
				//Billing_Rate = ifnull(data.get("Billing_Rate").toDecimal(),0.00);
			}
			else
			{
				Client_Name = "";
				Billing_Rate = 0.00;
			}
			Manager_s_Email_ID = data.get("Manager_s_Email_ID");
			info Manager_s_Email_ID;
			Zoho_Access_Required = data.get("Zoho_Access_Required");
			//info Title_Designation;
			Date_Of_joining = data.get("Date_Of_joining").toString("dd-MMM-yyyy");
			//info Date_Of_joining;
			Location = data.get("Employee_Seating_Location");
			///prob
			//info Location;
			Working_hrs = data.get("Shift_Timings");
			//info Working_hrs;
			Employee_Role = ifnull(data.get("Employee_Role"),"");
			//info Employee_Role;
			Email_Client = ifnull(data.get("Email_Client"),"");
			//info Email_Client;
			Employee_type = data.get("Employee_type");
			//Email_id = data.get("Email");
			// // 		//////////
			//find find location, desigination, department
			//https://people.zoho.com/people/api/forms/department/views
			AllDesignations = list();
			fetchDesignationsList = {1,2,3,4,5,6,7,8,9,10};
			for each  designationList in fetchDesignationsList
			{
				if(designationList == 1)
				{
					startIndex = 1;
				}
				else
				{
					startIndex = (designationList - 1) * 100 + 1;
				}
				get_designation = invokeurl
				[
					url :"https://people.zoho.com/people/api/forms/P_DesignationView/records?sIndex=" + startIndex + "&rec_limit=100"
					type :GET
					headers:O_AuthToken
				];
				//info get_designation;
				for each  des in get_designation
				{
					AllDesignations.add(des);
				}
				if(get_designation.size() < 100)
				{
					break;
				}
			}
			designationID = null;
			for each  desig in AllDesignations
			{
				if(desig.get("Designation Name") == Title_Designation)
				{
					designationID = desig.get("recordId");
					//info designationID;
					break;
				}
			}
			//info designationID;
			// // ////////////////////////
			////
			/////for adding reporting to
			///////////////////
			get_manager_data = invokeurl
			[
				url :"https://people.zoho.com/people/api/forms/employee/getRecords?searchParams={searchField: 'EmailID', searchOperator: 'Is', searchText : " + Manager_s_Email_ID + "}"
				type :GET
				headers:O_AuthToken
			];
			data = get_manager_data.get("response").get("result");
			//info "manager data" + data;
			for each  data in data
			{
				manager_id = data.keys();
				//info "Manager email id: " + manager_id;
				manager_id = manager_id.substring(0);
				manager_id = manager_id.toNumber();
			}
			/////////////////
			/////////////
			/////////////////
			///////////////////
			data = {"EmployeeID":get_latatest_emp_id,"FirstName":First_name,"LastName":Last_Name,"Work_location":Location,"Designation":designationID,"Dateofjoining":Date_Of_joining,"Working_Hours":Working_hrs,"Role":Employee_Role,"Email_Client":Email_Client,"Employee_type":Employee_type,"Department":zoho_people_dep_id,"Zoho_Access_Required":Zoho_Access_Required,"Reporting_To":manager_id,"Client_Type":Client_Type,"Client_Name":Client_Name};
			inputdata = Collection();
			inputdata.insert("inputData":data);
			inputdata.insert("isNonUser":true);
			create_employee = invokeurl
			[
				url :"https://people.zoho.com/people/api/forms/json/employee/insertRecord"
				type :POST
				parameters:inputdata.toMap()
				headers:O_AuthToken
			];
			info "Create employee response: " + create_employee;
		}
	}
}
catch (e)
{
	sendmail
	[
		from :zoho.adminuserid
		to :"usman@erphub.biz","auto@rebiz.zohodesk.com"
		subject :"Zoho Recruit/Workflow Failure/create_employee_on_zoho_people / " + First_name + Last_Name
		message :e + "   RECORD ID: " + rec_id
	]
}
<div class="coupon--card-content">
<h2>Limited Time Offer Flat 20% Off!</h2>														<p>Get 20% off on your first order of medicines. Shop now and save on your healthcare essentials!</p>
<h3>FLAT20</h3>
<a href="javascript:void(0)" data-coupon="FLAT20" class="copy-text">
Use Coupon</a></div>

import $, { contains } from 'jquery';

class Coupon {
	constructor(element) {
		this.$element = $(element);
		this.$copy = $(element).find('.copy-text');
		this.init();
	}

	init() {
		this.$copy.on('click', function (e) {
			e.preventDefault();
			let target = $(this).data('coupon');
			navigator.clipboard.writeText(target).then(() => {
				console.log(`Copied: ${target}`);
			});
		});
	}
}

$('[data-coupon]').each((index, element) => new Coupon(element));
This Case Study Assignment Help program is designed to enhance students' analytical, research, and writing skills. It covers:

✅ Understanding Case Studies – Learn different types (Business, Law, Nursing, etc.) and their structure.
✅ Research & Data Collection – Identify credible sources and interpret qualitative & quantitative data.
✅ Writing Techniques – Develop problem statements, analyze cases, and present well-structured solutions.
✅ Editing & Proofreading – Avoid common mistakes, ensure proper formatting (APA, MLA, Harvard), and refine your work.
✅ Practice & Expert Support – Review sample case studies, receive personalized feedback, and consult industry experts.

This program provides hands-on learning, real-world applications, and access to expert guidance, helping students excel in case study assignments.
Visit : https://myassignmenthelp.expert/case-study-assignment-help.html
---------- set bearer token-----------
const token = pm.environment.get("TOKEN");

console.log(token)

if (!token) {
    console.error("Token is not set in the environment.");
    throw new Error("Token is missing. Please set the token in the environment.");
}

pm.request.headers.add({
    key: "Authorization",
    value: `Bearer ${token}`
});
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":cute-sun: Boost Days - What's On This Week :cute-sun:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n :xero-hackathon: Happy Hackathon Week Melbourne! :xero-hackathon:"
			}
		},
		{
			"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 :gingerman: Ginger Crunch Slice  \n\n :lemon-flower: Lemon Yuzu Coconut Slice \n\n *Weekly Café Special:* _Creme Egg Latte_ :easter_egg:"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Monday, 7th April :calendar-date-7:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hackathon kick off lunch in the L3 Breakout Space! Enjoy some burgers and sides from Royal Stacks :homer-eating-burger: "
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " Wednesday, 9th April :calendar-date-9:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": " \n\n :lunch: *Light Lunch*: Provided by Kartel Catering from *12pm* \n\n"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Thursday, 10th April :calendar-date-10:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":breakfast: *Breakfast*: Provided by *Kartel Catering* from *8:30am - 10:30am* in the Wominjeka Breakout Space."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":xero-hackathon: Hackathon 2025 :xero-hackathon: ",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Hackathon is BACK!* We will have fresh juices and treats to fuel our participants brains and supercharge your days in the L3 Kitchen every single day this week!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned for more fun throughout the year. :party-wx:"
			}
		}
	]
}
01)Minimum Platforms

https://www.geeksforgeeks.org/problems/minimum-platforms-1587115620/1
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " :sunshine::x-connect: Boost Days: What's on this week :x-connect: :sunshine:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Good morning Brisbane, \n\n Happy Hackathon week for those participating! See below for what's on this week."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-7: Monday, 7th April",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n :meow-coffee: *Café Partnership*: Enjoy free coffee and café-style beverages from our Cafe partner *Edwards*.\n\n :Lunch: *Lunch*: provided by _Greenstreat_ from *12pm* in the kitchen.\n\n:massage:*Wellbeing*: Pilates at *SP Brisbane City* is bookable every Monday!"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-9: Wednesday, 9th April",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n :meow-coffee: *Café Partnership*: Enjoy free coffee and café-style beverages from our Cafe partner *Edwards*. \n\n:lunch: *Morning Tea*: provided by _Etto Catering_ from *10am* in the kitchen!"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":xero-hackathon: Hackathon 2025 :xero-hackathon:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "To Supercharge your brains for Hackathon and get the creative juices flowing, we'll have cold juice and delicious snacks on offer every single day for you to help yourselves to! :juicebox: "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y19uY2M4cDN1NDRsdTdhczE0MDhvYjZhNnRjb0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Brisbane Social Calendar*>\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
OLLAMA_ORIGINS='*' OLLAMA_HOST=localhost:11434 ollama serve
cp -RPp ./example.env ./.env
npm clean-install
npm run dev
git clone https://github.com/ollama-webui/ollama-webui.git ./ollama-webui/
pushd ./ollama-webui/
webi node@lts
source ~/.config/envman/PATH.env
~/.config/envman/PATH.env
~/.local/bin/ollama
~/.ollama/models/
ollama pull mistral
ollama run mistral
star

Sun Apr 06 2025 18:11:50 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 18:07:27 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 18:06:37 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 18:06:02 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 18:05:24 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 18:04:37 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:56:29 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:56:00 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:53:15 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:52:53 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:52:31 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:52:01 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:50:15 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:48:52 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:48:04 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:46:48 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:46:09 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:45:02 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:44:30 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:42:31 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:40:45 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:39:28 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 17:38:25 GMT+0000 (Coordinated Universal Time)

@exam3

star

Sun Apr 06 2025 12:31:43 GMT+0000 (Coordinated Universal Time) https://rootguide.co.za/2023/01/27/powershell-scripts-for-automating-windows-server-management/

@thefunkytechguy #powershell #activedirectory #windowserver #wsus

star

Sun Apr 06 2025 11:40:26 GMT+0000 (Coordinated Universal Time) https://github.com/migo557/temurin-build/pull/1

@Mido4477

star

Sat Apr 05 2025 15:55:22 GMT+0000 (Coordinated Universal Time)

@yummyo

star

Sat Apr 05 2025 12:26:25 GMT+0000 (Coordinated Universal Time) https://www.beleaftechnologies.com/crypto-algo-trading-bot-development

@raydensmith #crypto #algo

star

Sat Apr 05 2025 05:55:26 GMT+0000 (Coordinated Universal Time) https://cli.github.com/manual/gh_attestation_download

@Mido4477

star

Sat Apr 05 2025 05:55:16 GMT+0000 (Coordinated Universal Time) https://cli.github.com/manual/gh_attestation_download

@Mido4477

star

Sat Apr 05 2025 04:18:17 GMT+0000 (Coordinated Universal Time)

@wizyOsva #bash #cifs

star

Sat Apr 05 2025 00:29:52 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry

@Mido4477

star

Fri Apr 04 2025 23:05:36 GMT+0000 (Coordinated Universal Time) https://semver.org/

@Mido4477

star

Fri Apr 04 2025 14:32:52 GMT+0000 (Coordinated Universal Time)

@yummyo

star

Fri Apr 04 2025 14:32:52 GMT+0000 (Coordinated Universal Time)

@yummyo

star

Fri Apr 04 2025 14:11:26 GMT+0000 (Coordinated Universal Time)

@Hassnain_Abbas #html

star

Fri Apr 04 2025 12:40:39 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #css #html

star

Fri Apr 04 2025 10:44:14 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/cryptocurrency-wallet-development-company/

@CharleenStewar

star

Fri Apr 04 2025 09:59:44 GMT+0000 (Coordinated Universal Time) https://myassignmenthelp.expert/case-study-assignment-help.html

@john09

star

Fri Apr 04 2025 08:10:06 GMT+0000 (Coordinated Universal Time)

@StephenThevar

star

Fri Apr 04 2025 06:40:28 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/localcryptos-clone-script/

@janetbrownjb #peertopeercryptoexchange #localcryptosclonescript #cryptoexchangedevelopment #p2pexchangeplatform #cryptocurrencystartup

star

Fri Apr 04 2025 03:45:17 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Thu Apr 03 2025 15:52:59 GMT+0000 (Coordinated Universal Time)

@aniket_chavan

star

Thu Apr 03 2025 05:00:53 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Wed Apr 02 2025 09:14:34 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/bitstamp-clone-script/

@janetbrownjb #bitstampclonescript #cryptoexchangedevelopment #launchcryptoexchange #cryptotradingplatform #bitstamplikeexchange

star

Tue Apr 01 2025 20:28:45 GMT+0000 (Coordinated Universal Time) https://webinstall.dev/ollama/

@hmboyd

star

Tue Apr 01 2025 20:28:29 GMT+0000 (Coordinated Universal Time) https://webinstall.dev/ollama/

@hmboyd

star

Tue Apr 01 2025 20:28:13 GMT+0000 (Coordinated Universal Time) https://webinstall.dev/ollama/

@hmboyd

star

Tue Apr 01 2025 20:27:55 GMT+0000 (Coordinated Universal Time) https://webinstall.dev/ollama/

@hmboyd

star

Tue Apr 01 2025 20:27:38 GMT+0000 (Coordinated Universal Time) https://webinstall.dev/ollama/

@hmboyd

star

Tue Apr 01 2025 20:27:14 GMT+0000 (Coordinated Universal Time) https://webinstall.dev/ollama/

@hmboyd

Save snippets that work with our extensions

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