Skip to content

Instantly share code, notes, and snippets.

View anjanesh's full-sized avatar

Anjanesh Lekshminarayanan anjanesh

View GitHub Profile
@anjanesh
anjanesh / error-message.html
Last active April 22, 2023 05:07
Error Messages in Chrome vs FireFox
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Error Messages in Chrome vs FireFox</title>
</head>
<body>
<script type="text/javascript">
const DEBUG = true;
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Flowbite Dynamic Nav Menu</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<script>
let BASE_URL = window.location.origin + window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/"));
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Div Form using Global Apline Storage Variable</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js" defer></script>
<script>
let content = [
{ name: 'Test 1', description: 'Test Description 1' },
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>RazorUI FAQ</title>
<style type="text/css">
#razorui-faq
{
border: 1px solid red;
@anjanesh
anjanesh / toxicity-webserver.ts
Last active February 28, 2023 07:40
deno webserver returning JSON for tensorflowJS for toxicity model
import tfjs from "npm:@tensorflow/[email protected]";
import * as toxicity from "npm:@tensorflow-models/[email protected]";
const server = Deno.listen({ port: 8080 });
console.log(`HTTP webserver running. Access it at: http://localhost:8080/`);
const threshold = 0.5;
let t0 = performance.now();
let arrToxicity = {};
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>AutoSave TextArea Contents</title>
<script src="https://unpkg.com/[email protected]/dist/cdn.min.js" defer></script>
</head>
<body>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>AlpineJS - Indian Number System for Amount in Rupees</title>
<script src="https://unpkg.com/[email protected]/dist/cdn.min.js" defer></script>
<script>
const INR_THOUSAND = 1000;
@anjanesh
anjanesh / rallycoding.201.js
Last active January 28, 2021 05:29
Longest Increasing Sequence
// https://www.rallycoding.com/problems/201
const solve = (intArray) =>
{
let a = [], l;
let b = [], m = 0;
let i, j;
for (i = 0; i < intArray.length - 1; i++)
{
@anjanesh
anjanesh / mega-menu.html
Created January 9, 2021 12:27
Mega Menu using CSS only
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap" rel="stylesheet">
<title>Mega Menu using CSS only</title>
<style type="text/css">
body { font-family: Roboto; font-weight: normal; }
@anjanesh
anjanesh / number2words.js
Created October 20, 2020 00:58
Number to words (crore and lakh)
const HUNDRED = 100;
const THOUSAND = HUNDRED * 10;
const LAKH = THOUSAND * 100;
const CRORE = LAKH * 100;
const TN = ['ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'];
const TY = ['twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'sixteen', 'eighty', 'ninety'];
const O = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];
function number2words(num)