Skip to content

Instantly share code, notes, and snippets.

View masonwan's full-sized avatar

Mason Wan masonwan

View GitHub Profile

Problem

When install Windows on a older devices, many devices could potentially wake up the computer from the sleep mode.

It's possible to identify them using the Event Viewer. But it's always a hassle.

Solution

Run the following PowerShell in terminal to disable all devices capable to wake the computer. And then identify the devices we really want to wake the computer in Device Manager, and set thier Power Management.

@masonwan
masonwan / fade-unwanted-meals.js
Created February 24, 2025 01:17
The script works with HelloFresh.com. It fades out veggie, vegan, no-cook, or anything with extra fee. It works best to be a bookmarklet.
const unwantedTags = [
'Veggie',
'Vegan',
'No Cook',
]
const menuElms = [...document.querySelectorAll(`#page > div > div > div > div > div.sc-54d3413f-0.cWKOLc > div.sc-54d3413f-0.cAaXLm > div > div > div`)]
const meals = menuElms
.map((menuElm, i) => {
fadeOutUnwantedMeals(menuElm)

Copy the following code into the URL of your bookmark.

javascript:openAiTabs();function openAiTabs(){const t=URL.parse(location.href);let e=t.searchParams.get("q");e==null&&(e=`tldr ${t}`),search(e)}function search(e){const t=["https://www.google.com/search?udm=50&q=%s","https://chatgpt.com/?hints=search&q=%s","https://grok.com/?q=%s","https://www.perplexity.ai/search/?copilot=false&q=%s"];t.forEach(t=>{window.open(t.replace("%s",e),"_blank")})}

The unminified version

// It opens popular AI search with the query parameter in the URL (`?q=`).