Skip to content

Instantly share code, notes, and snippets.

View nidhinkumar06's full-sized avatar

Nidhinkumar nidhinkumar06

View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1920, height=1080" />
<title>HeyGen — AI Video Intro</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500&display=block"
@nidhinkumar06
nidhinkumar06 / index.html
Created April 19, 2026 17:29
HeyFrame Multilingual Sample
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1920, height=1080" />
<title>HeyGen — AI Video for India</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<!--
Noto Sans family covers all Indic scripts cleanly.
@nidhinkumar06
nidhinkumar06 / emailPattern
Created August 24, 2024 15:22
Email Pattern to extract emails
\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,63}\b
@nidhinkumar06
nidhinkumar06 / Regexpattern
Created August 24, 2024 14:26
Regex Pattern to extract urls from Map for Make automation
(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?\.com\/?[a-zA-Z0-9]{0,}((https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?\.com)?|(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})?\.com
@nidhinkumar06
nidhinkumar06 / generateWorkBook.js
Created November 27, 2021 17:42
Grafana Excel Report
const Excel = require("exceljs");
generateWorkBook = (res, workBookDatas) => {
var workbook = new Excel.Workbook();
/** CPU Usage Sheet */
var cpuUsageSheet = workbook.addWorksheet('CPU USAGE');
@nidhinkumar06
nidhinkumar06 / cpuUsage.js
Created November 27, 2021 17:41
Grafana Excel Report
const { InfluxDB, flux } = require("@influxdata/influxdb-client");
const { url, token, org, bucket, timeout } = require("./env");
getCPUUsage = async (startDuration, endDuration) => {
const queryApi = new InfluxDB({ url, token, timeout }).getQueryApi(org);
const fluxQuery = flux`from(bucket:"${bucket}") |> range(start: ${startDuration}, stop: ${endDuration}) |> filter(fn: (r) => r._measurement == "cpu") |> filter(fn: (r) => r._field == "usage_user" or r._field == "usage_system" or r._field == "usage_idle") |> filter(fn: (r) => r.cpu == "cpu-total") |> aggregateWindow(every: 1h, fn: last, createEmpty: false) |> last()`;
const cpuUsageJSON = [];
await queryApi
@nidhinkumar06
nidhinkumar06 / env.js
Created November 27, 2021 17:29
Grafana Excel Report
/** InfluxDB v2 URL */
const url = 'http://localhost:8086/'
/** InfluxDB authorization token - Get all access token */
const token = ''
/** Organization within InfluxDB */
const org = ''
/**InfluxDB bucket used in examples */
const bucket = ''
const timeout = 500000
@nidhinkumar06
nidhinkumar06 / index.js
Created November 27, 2021 17:21
Grafana Excel Report
const express = require('express');
const moment = require('moment');
const momentGrafana = require('moment-relativism');
const { fluxDuration } = require("@influxdata/influxdb-client");
const { METRIC_HEADERS } = require('./constants');
const { getCPUUsage } = require("./cpuUsage");
const { generateWorkBook } = require("./generateWorkBook");
const app = express();
@nidhinkumar06
nidhinkumar06 / constants.js
Created November 27, 2021 17:16
Grafana Excel Report
const METRIC_HEADERS = [
{ header: "Time", key: "time", width: 32 },
{ header: "Host name", key: "host", width: 32 },
{ header: "Measurement", key: "measurement", width: 32 },
{ header: "Usage", key: "usage", width: 32 },
];
module.exports = {
METRIC_HEADERS,
@nidhinkumar06
nidhinkumar06 / systemmetric
Created October 23, 2021 11:01
Grafana system metric dashboard using InfluxDB2.0
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",