Skip to content

Instantly share code, notes, and snippets.

View SahilMahadwar's full-sized avatar
🎯
Learning

Sahil Mahadwar SahilMahadwar

🎯
Learning
View GitHub Profile
@SahilMahadwar
SahilMahadwar / gist:3ba2f85fcceb28e62b1352822be3c8c7
Created March 17, 2025 03:33
fullstack.cafe download all pdfs
(async function automateDownload() {
const batchSize = 20;
let index = 0;
function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
while (true) {
const items = document.querySelectorAll(".badge-add-to-pdf"); // Update this selector to match your items
@SahilMahadwar
SahilMahadwar / index.js
Created January 12, 2025 16:33
New IndexJs
const { port, env } = require('./config/vars');
const logger = require('./config/logger');
const app = require('./config/express');
const mongoose = require('./config/mongoose');
const https = require('https');
const fs = require('fs');
//const firebaseService = require('../src/api/services/firebase')
// open mongoose connection
mongoose
@SahilMahadwar
SahilMahadwar / index.js
Created November 25, 2024 05:56
Lambda image resizer
const AWS = require('aws-sdk');
const sharp = require('sharp');
const s3 = new AWS.S3();
exports.handler = async (event) => {
try {
const bucket = event.Records[0].s3.bucket.name;
const key = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, ' '));
const outputKey = `resized/${key}`;
{
"labelData": {
"667fd6b83fff91abf3d3751c": {
"style": [
"modern",
"minimalist",
"contemporary",
"sleek",
"functional"
],
@SahilMahadwar
SahilMahadwar / bing-wallpaper.sh
Last active May 11, 2025 01:12
You can use this script to automatically set Bing's image of the day as your wallpaper. It downloads the image and saves it to a chosen folder. It also keeps track of downloaded images using a JSON file, so it won't download the same one twice. Just set it to run on every login to keep your wallpaper fresh!
#!/bin/bash
# Check internet connectivity
check_internet() {
wget -q --spider http://example.com
return $?
}
# Wait for internet connectivity
while ! check_internet; do
const nav = [
// Start Here is super parent
{
label: "Start Here",
// this link will throw an 404 and thats okay.
link: "/docs/start-here/", // if you notice start-here got converted to "Start Here" for label so you will have to do some string conversions
enabled: true,
subItems: [
{
label: "Install Astro", // "Install Astro" title is coming from markdown frontmatter field called linkTitle so if its a folder it will use folder name as parent if its a single file means its a page then we will use linkTitle
---
title: "Docs title"
linkTitle: "Link title"
description: example description
---
## Heading
content
@SahilMahadwar
SahilMahadwar / README.MD
Created August 20, 2022 20:45 — forked from AstralJohn/Reset Udemy Progress.md
Reset Udemy Progress

Reset Udemy Progress

Last Updated: 08/06/2022

Step 1. Go to Udemy course in browser

Go to the course and have any video up. The following code relies on the right sidebar to be visible to uncheck all your progress.

Step 2. Open browser console

You can do this with ctrl+shift+j and making sure the console tab is selected for chrome/brave