Skip to content

Instantly share code, notes, and snippets.

@mvark
mvark / vitamins.csv
Created May 21, 2024 17:02
Average values of micronutrients (minerals) in various food groups (per 100g raw weight). Source: Indian Food Composition Tables 2017 & Nutritive Values of Indian Foods
Foods Vitamin B1 (Thiamine) (µg) Vitamin B2 (Riboflavin) (µg) Vitamin B3 (Niacin) (µg) Vitamin B6 (Pyridoxine) (µg) Vitamin B9, Total folates (µg) Vitamin C (mg) Vitamin A (Retinol) (µg) Vitamin D (D2) (µg)
Cereals 238.46 84.6 2138.5 162.31 15.86 0 2.01 6.88
Millets 355.56 155.6 2177.8 113.33 24.17 0 1.02 6.1
Pulses 400 158.8 2123.5 215.53 157.06 0 8.32 8.69
GLVS 60 127.7 624.6 97.49 31.6 45.6 397.9 3.4
Roots & tubers 31.58 10.5 405.3 97.47 21.48 12.1 39.85 0.55
Vegetables 41.3 43.5 365.2 97.48 28.53 23.6 18.4 2.38
Nuts 390 140 3210 311.4 47.58 0.4 1.26 9.06
Fruits 34.78 21.7 369.6 65.04 11.41 36.7 35.48 3.62
Meat & poultry 81.82 109.1 2772.7 220 5.59 0 1.93 0
Constituency MLA Party
Achampet Dr CHIKKUDU VAMSHI KRISHNA Indian National Congress
Adilabad PAYAL SHANKER Bharatiya Janata Party
Alair ILAIAH BEERLA Indian National Congress
Alampur VIJAYUDU Bharat Rashtra Samithi
Amberpet KALERU VENKATESH Bharat Rashtra Samithi
Andole C. DAMODAR RAJANARSIMHA Indian National Congress
Armur Paidi Rakesh Reddy Bharatiya Janata Party
Asifabad KOVA LAXMI Bharat Rashtra Samithi
Aswaraopeta ADINARAYANA. JARE Indian National Congress
@mvark
mvark / transform.js
Created April 16, 2024 03:06
If you have products on a web page in a grid layout and you want it as a list, here's code that ChatGPT generated that you can use in the Developer Tools console for the required transformed output. Change the class or HTML attribute names as relevant to your case.
// Find all div elements with class "gallery-item"
const products = document.querySelectorAll('div.gallery-item');
// Array to store product list items
const productListItems = [];
// Iterate over each product
products.forEach(product => {
// Extract the hyperlink
const hyperlink = product.querySelector('a.block-wrapper-link').getAttribute('href');
@mvark
mvark / expenses.csv
Last active April 16, 2024 03:02
Pritesh Kakani tweeted that expenses for a family of 4 in a Metro city in India is ~20 lakh per year & gave a break-down of the expenses - https://twitter.com/pritesh_kakani/status/1779388591132566013 . You may disagree with the expenses he has posted and if you want to customize the numbers to estimate your expenses, use this CSV file
Thing Monthly Cost Yearly Cost
Rent/EMI for home 35000 420000
Child School+Extracurriculars 400000
Car EMI+Maintainance+Insurance 200000
1 Asia/India Trip 150000
Food 10000 120000
Apparels/ Footwear/ Accessories 10000 120000
Healthcare 8000 96000
Car + Bike Petrol 5350 64200
Electronics(Laptop, Mobile, AC, TV, Washing Machine) 50000
@mvark
mvark / ReverseClockBookmarklet.js
Created February 21, 2024 12:03
Reverse Clock Bookmarklet - This handy tool counts down the time you set, helping you stay focused and improve your estimation skills for tasks like reading articles, watching videos, or completing online assignments.
javascript:(function() {
var t, ts, h, m, s, u, c, tmr, f = document.createElement("div");
f.id = "revClock";
f.style.cssText = "position: fixed; top: 10px; right: 10px; background-color: rgba(0, 0, 0, 0.5); padding: 10px; z-index: 9999; text-align: center; font-size: 20px; color: white;";
document.body.appendChild(f);
t = prompt("Enter number of minutes:");
if (t === null || isNaN(t) || t < 0) {
alert("Invalid input. Please enter a positive number for minutes.");
return;
@mvark
mvark / Tags
Created February 15, 2024 03:44
This PowerShell script is based on a script by MotoX80. It fetches all the tags listed on Microsoft Q&A along with their hyperlinks to construct this web page - https://codepen.io/mvark/full/zYbyLgd
1..15 | foreach {
$page = Invoke-WebRequest "https://learn.microsoft.com/en-us/answers/tags/?orderBy=Popular&page=$($_)"
$page.AllElements | Where-Object -Property Class -eq 'card-title' | ForEach-Object {
"<li><a href=`"https://learn.microsoft.com$($_.href)`" target=`"_blank`">$($_.innerText)</a></li>"
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Based on this HTML5 QR Code Reader sample by Minhaz https://blog.minhazav.dev/research/html5-qrcode.html -->
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>NutriScan</title>
<style>
#desc {
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Based on this HTML5 QR Code Reader sample by Minhaz https://blog.minhazav.dev/research/html5-qrcode.html -->
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>OFF Barcode Scanner</title>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Based on this HTML5 QR Code Reader sample by Minhaz https://blog.minhazav.dev/research/html5-qrcode.html -->
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>OFF Bar Code Scanner</title>
</head>
<body>
@mvark
mvark / location.html
Created January 9, 2024 07:35
Simple JavaScript code sample to detect location through an API call to IPAPI web service
<!DOCTYPE html>
<html>
<head>
<title>Location Detection</title>
</head>
<body>
<div id="userDetails"></div>
<script>