Skip to content

Instantly share code, notes, and snippets.

View SMUsamaShah's full-sized avatar
🎯
Focusing ... almost

Muhammad Usama SMUsamaShah

🎯
Focusing ... almost
View GitHub Profile
@SMUsamaShah
SMUsamaShah / gmail_sort_by_sender.js
Last active March 3, 2025 07:51
Gmail sort by sender bookmarklet (drag the code to bookmark bar)
javascript:(function() {
function sortEmailsBySender() {
var emails = Array.from(document.querySelectorAll('.zA'));
emails.sort(function(a, b) {
var senderA = a.querySelector('.yW span').innerText.toLowerCase();
var senderB = b.querySelector('.yW span').innerText.toLowerCase();
return senderA.localeCompare(senderB);
});
emails.forEach(function(email) {
email.parentNode.appendChild(email);
@SMUsamaShah
SMUsamaShah / list_of_fast_windows_softwares.md
Last active June 3, 2024 16:47
List of Fast (no-bloat) Windows Softwares

Actually Fast Windows Tools

A good criteria to judge if a tool will be fast is often the package size. Tools in or under 10s of MBs usually do one thing and do it really well.

Tools listed here have fast/instant startup and/or handles large files without slowing everything down.

Document Editors / Viewers

  1. Notepad++ https://notepad-plus-plus.org/
  2. Notepad2 Notepad3 (not sure if these are actually fast)
@SMUsamaShah
SMUsamaShah / sort roms by genre.md
Last active February 28, 2025 17:29
Sort ROM files by Genre using ChatGPT

I tried writing shell script, then actual code for this. Found some lists

https://github.com/Wiimpathy/CreateCat/blob/master/data/GBA/GBA_list.txt https://github.com/libretro/libretro-database/blob/master/metadat/genre/Nintendo%20-%20Game%20Boy%20Advance.dat

and even tried screenscraper api

but the problem always was finding and matching names correctly.

Gave up on that and simply used ChatGPT. It's reliable enough. Not many mistakes and even if it makes mistakes its not that big deal and overall this method is lot less painfull.

@SMUsamaShah
SMUsamaShah / libretro_genre_to_json.sh
Last active February 28, 2025 17:26
Bash script to convert libretro genre metadata .dat files to json (works on miyoo mini)
#!/bin/sh
input_file="gba.dat"
output_file="output.json"
# declare -A crc_to_genre
# declare -A name_to_genre
inside_game_block=false
crc_to_genre_json=""
@SMUsamaShah
SMUsamaShah / dailynotes.bat
Last active March 1, 2024 18:59
(Windows) Daily Notes Prompt at end of work day
@echo off
REM Use: "script.bat Your note here" to append a note to 'daily_note_YYYY_MM_DD.txt'.
REM If no argument given, type note interactively. Press Enter on an empty line to finalize.
REM Note is saved in 'd:\notes'.
setlocal enabledelayedexpansion
REM Creating a Newline variable (the two blank lines are required!) src: https://stackoverflow.com/a/269819/342095
set NLM=^
@SMUsamaShah
SMUsamaShah / Hacker_News_Story_Rank_Change_Indicator.user.js
Last active November 6, 2024 13:27
UserScript: Indicate New/Unread HN stories on front page since your last visit.
// ==UserScript==
// @name Hacker News Story Rank Change Indicator
// @namespace http://tampermonkey.net/
// @version 2024-09-07_15-42
// @description Indicate the new stories and stories moving up/down on the front page
// @author SMUsamaShah
// @match https://news.ycombinator.com/
// @match https://news.ycombinator.com/news
// @match https://news.ycombinator.com/news?p=*
// @match https://news.ycombinator.com/?p=*
@SMUsamaShah
SMUsamaShah / Globals.json
Created December 25, 2023 00:04
Kwgt weeks in a year calendar widget
##KUSTOMCLIP##
{
"clip_version": 1,
"KUSTOM_GLOBAL": {
"gcol1": {
"index": 0,
"type": "COLOR",
"title": "gcol1",
"value": "#FFAFAFAF",
"key": "gcol1"
@SMUsamaShah
SMUsamaShah / Retro consoles capability.md
Last active December 20, 2023 09:37
Retro consoles sorted/grouped by games quality

Played games from these consoles on Miyoo Mini Plus.

Simplest (2D games, no textures)

  • Intellivision
  • Atari 2600
  • Vectrex (line drawing, good games)
  • Odyssey (difficult to control on miyoo mini)

not that simple

  • Colecovision (complicated controls for miyoo mini)
@SMUsamaShah
SMUsamaShah / find duplicate roms.md
Last active December 14, 2023 16:12
miyoo mini find duplicate roms

Find duplicate roms on Miyoo Mini (running BusyBox) when roms are zipped (.zip/.7z) and each zip contains just one file.

This command finds and lists all duplicates.

find . \( -name '*.zip' -o -name '*.7z' \) -type f -exec sh -c 'if [ "${1##*.}" = "zip" ]; then echo `unzip -p "{}" | md5sum` "{}"; else echo `7z e "{}" -so | md5sum` "{}"; fi' -- {} \; | sort | awk 'BEGIN{last_hash=""; last_line=""; seen_duplicate=0} {if ($1 == last_hash) {if (!seen_duplicate) print last_line; print $0; seen_duplicate=1} else seen_duplicate=0; last_hash=$1; last_line=$0}'

example output:

91128778a332495f77699eaf3a37fe30 - ./Alleyway.zip
@SMUsamaShah
SMUsamaShah / ublock filters.md
Last active November 15, 2023 21:46
uBlock filters

Google

Hide suggested labels

www.google.com###bres

eBay