Skip to content

Instantly share code, notes, and snippets.

View tushgaurav's full-sized avatar
♾️
"use github";

Tushar Gaurav tushgaurav

♾️
"use github";
View GitHub Profile
@tushgaurav
tushgaurav / browser.py
Created September 2, 2025 07:06
Headless Script
from playwright.sync_api import sync_playwright
def cnc_machine():
with sync_playwright() as p:
browser = p.firefox.launch(headless=True)
page = browser.new_page()
page.goto("http://192.168.7.2/#production")
time.sleep(10) # Wait for page to load
# Click the HOME ALL button
@tushgaurav
tushgaurav / index.ts
Created March 21, 2025 06:51
Odoo eLearning - Fetch All Courses Data
async function fetchCourses(odooUrl: string = "https://admin.orangewood.co") {
try {
const courseUrl = "/slides/all";
const res = await fetch(odooUrl + courseUrl);
const html = await res.text();
const courses = [];
const courseCardRegex = /<div class="card w-100 o_wslides_course_card mb-4[^>]*>[\s\S]*?<\/div>\s*<\/div>\s*<\/div>/g;
const courseCards = html.match(courseCardRegex) || [];
@tushgaurav
tushgaurav / install.ps1
Created February 9, 2023 05:22
Customize Terminal in Windows - Oh My Posh
# Install OhMyPosh
winget install JanDeDobbeleer.OhMyPosh -s winget
# Get the current shell
oh-my-posh get shell
# Get the location of the PROFILE
$PROFILE
# Open profile file in notepad