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
// Ensure jsPDF is loaded only if not already present | |
if (typeof jsPDF === 'undefined') { | |
const jspdfScript = document.createElement('script'); | |
jspdfScript.onload = function () { | |
generatePDF(); | |
}; | |
jspdfScript.src = 'https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js'; | |
document.body.appendChild(jspdfScript); | |
} else { | |
generatePDF(); |
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
/** | |
* Usage: | |
* | |
* const groq = new Groq({ initialMessages: [], systemPrompt: "Always give helpful and polite responses." }); | |
* const response = await groq.sendMessage("Hello"); // response.message | |
*/ | |
import axios from "axios"; | |
const groqApi = axios.create({ |
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 need to be pasted fast (before ws connects!) | |
let queue = []; | |
let initial = true; | |
function handler(wsUrl) { | |
const ws = new WebSocket(wsUrl); | |
console.log("Type hi('msg') to send a message!"); | |
setInterval(() => { |
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
[ | |
{ | |
"state": "Andaman & Nicobar Islands", | |
"data": [ | |
{ | |
"fy": "13-14", | |
"release": 29.13, | |
"expenditure": 29.19 | |
}, | |
{ |
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
echo "Enter service name: " | |
read servicename | |
echo "Enter the domain: " | |
read domain | |
echo "Enter port: " | |
read port | |
echo 'server { | |
listen 80; | |
server_name '$domain'; |
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 t1 = 20; // celcius | |
let t2 = 45; // celcius | |
let sgt1 = 2.4167; // eg sg-5°C | |
let sgt2 = 2.4368; | |
let cpgt2 = 1.945; | |
let hgt1 = 613.8; | |
let hgt2 = 649.31; | |
let hft2 = 309.68; | |
let vgt1 = 0.18823; |
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 http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Route</title> | |
</head> |
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
echo "Enter input video path with extension (Ex. input.mp4)" | |
read input_path | |
echo "Enter output folder (Ex. output)" | |
read output_path | |
mkdir $output_path | |
ffmpeg -hide_banner -y -i $input_path \ | |
-vf scale=w=640:h=360:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename $output_path/360p_%03d.ts $output_path/360p.m3u8 \ | |
-vf scale=w=842:h=480:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -hls_segment_filename $output_path/480p_%03d.ts $output_path/480p.m3u8 \ |
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
echo "Enter the cloud-storage-bucket URL (Starts with gs://): " | |
read cloud_storage_bucket | |
echo '[{"origin":["*"],"method":["GET"],"maxAgeSeconds":3600}]' > cors.json | |
gsutil cors set cors.json $cloud_storage_bucket | |
rm cors.json | |
echo "CORS Setted, Now go back to https://github.com/cachecleanerjeet/firecdn" |
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
polkit.addRule(function(action, subject) { | |
if ((action.id == “org.freedesktop.color-manager.create-device” || action.id == “org.freedesktop.color-manager.create-profile” || action.id == “org.freedesktop.color-manager.delete-device” || action.id == “org.freedesktop.color-manager.delete-profile” || action.id == “org.freedesktop.color-manager.modify-device” || action.id == “org.freedesktop.color-manager.modify-profile”) && subject.isInGroup(“{group}”)) | |
{ | |
return polkit.Result.YES; | |
} | |
}); |