Skip to content

Instantly share code, notes, and snippets.

View vikaspotluri123's full-sized avatar
:bowtie:
Space Battles 🚀

Vikas Potluri vikaspotluri123

:bowtie:
Space Battles 🚀
View GitHub Profile
@vikaspotluri123
vikaspotluri123 / runme.js
Created September 5, 2022 23:58
Convert Green Button power data to InfluxDB LineProtocol
// @ts-check
/* eslint-disable no-console */
import path from 'path';
import {readFile} from 'fs/promises';
import {createWriteStream} from 'fs';
import {argv, exit, cwd} from 'process';
let config;
let getPrice;
@vikaspotluri123
vikaspotluri123 / README.md
Created January 24, 2022 00:17
ESM import tree generator

Node ESM Tracer

This gist leverages Node's experimental loader hooks to create a dependency tree of your app. This can be useful to find circular dependencies, or diagnose race conditions / import order issues. Note: Experimental Loader Hooks are, well, experimental! This has been validated to run against Node v16.13.0

Here's the output of running NODE_NO_WARNINGS=1 node --experimental-loader=./loader-tracer.js index.js with this gist:

index.js
 (node{,_modules} excluded)
@vikaspotluri123
vikaspotluri123 / gcd.js
Last active January 30, 2018 04:15
Greatest Common Denominator
let a = 30030
let b = 257
const simplify = (a,b) => ({a: b%a, b: a});
if(a > b) {
let t = a;
a = b;
b = t;
}
@vikaspotluri123
vikaspotluri123 / keybase.md
Created January 26, 2018 00:45
Keybase Verification

Keybase proof

I hereby claim:

  • I am vikaspotluri123 on github.
  • I am vikaspotluri123 (https://keybase.io/vikaspotluri123) on keybase.
  • I have a public key ASA0UhH6DGjqfkSi6YxLKfffZEm7FBcM4knR7HtBru3i2Qo

To claim this, I am signing this object:

@vikaspotluri123
vikaspotluri123 / Youtube Download Full Channel
Last active July 8, 2023 22:04
Download all of the videos in a youtube channel as mp3
const API_KEY = "API_KEY_HERE"
const API_URL = "https://www.googleapis.com/youtube/v3/search"
const API_PATH = "/youtube/v3/search"
const https = require("https"); // I'm not sure why nodejs https API uses const but I'll trust them :)
const exec = require("child_process").exec;
var API_PARAMS =
{
"key" : API_KEY,
"channelId" : "CHANNEL ID",
//"channelName" : "Just so you know :)",