🎯
- royin.in, sadhansangha.org
- https://youtube.com/astrarudra
- astrarudra
- astrarudra
- @rudraroy91
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const filterYTVideoFormats = (info) => { | |
const { formats, requested_formats } = info | |
let bestAudio = requested_formats.find(o => o.vcodec === "none") | |
const filteredFormats = Object.values(formats.reduce((acc, curr) => { | |
if(!curr.height || curr.height < 480 || curr.format_note === "Premium") return acc | |
curr.vcodec = curr.vcodec.split('.')[0] | |
const selected = acc[curr.height] | |
// Already there is a selecton for this height - Select Better, use approx if filesize not available | |
if(selected){ | |
let better = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>WebGL Test</title> | |
<script> | |
window.onload = function() { | |
var canvas = document.createElement('canvas'); | |
document.body.appendChild(canvas); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Rudra Roy | |
Tutodial/Demo: https://www.youtube.com/watch?v=KsMNGolq-Fs | |
Description: | |
This script deletes all business chats from WhatsApp Web. | |
It is usefulsince most business chats are spam and are not useful. | |
This script is to be run in the console of the WhatsApp Web page. | |
*/ | |
const contextMenuEvent = new MouseEvent("contextmenu", { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Rudra Roy | |
Description: | |
This script exports greytHR holidays in iCal format. | |
Used for syncing holidays to calendars - Apple, Google, Outlook, etc. | |
*/ | |
// Constants for customizing holiday Reason | |
const prefix = 'Holiday: ' | |
const optPostFix = ' (Optional)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 13 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This script checks the version of a JSON response from a gist raw API endpoint every 500 milliseconds to find out the update efficency. | |
* Run this exactly update clicking update JSON, check my test.json jist. Clone it and modify the version. | |
* If the version is X, it logs the data. If the version is not X, it logs the current time, the version, | |
* and the time difference between the request initiation and the response reception. | |
* The script also ensures that the API response is not cached by appending a unique timestamp | |
* to each request URL and setting cache control options. | |
*/ | |
let intervalId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let intervalId; | |
let a = new Date(); | |
let success = 0 | |
const checkVersion = async () => { | |
try { | |
// Append the current timestamp to the URL to prevent caching | |
const response = await fetch(`https://gist.githubusercontent.com/astrarudra/c9a7783d2a4a334a192235d762a27c0d/raw?timestamp=${(new Date()).getTime()}`, { | |
cache: "no-store" // Also try to prevent cache on fetch request | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"version": "1.0"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createWithEqualityFn } | |
from 'zustand/traditional' | |
import { immer } from 'zustand/middleware/immer' | |
import { shallow } from 'zustand/shallow' | |
/* I named it OxyStore - Using | |
createWithEqualityFn for Default Equality fn. */ | |
const useOxyStore = createWithEqualityFn( | |
immer(// Immutable State & no return required. | |
(...o) => ({ | |
...generalSlice(...o), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": "I am data from gist, API call was a success!" | |
} |
OlderNewer