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 / life_in_the_uk_test_17_exams_questions_answers_explanations.md
Created October 8, 2025 17:42
Life in the UK test 17 exams questions answers and explanations

Life in the UK Quiz: All 17 Tests Solution

Test # Q# Question Text Correct Answer(s) Explanation
1 1 What are two responsibilities that you will have as a British citizen or permanent resident of the UK? 1. To look after the area in which you live and the environment
2. To look after yourself and your family
If you wish to be a permanent resident or citizen of the UK, you should: look after yourself and your family, look after the area in which you live and the environment, respect and obey the law, respect the rights of others, including their right to their own opinions and treat others with fairness.
1 2 Where is Big Ben located? The Houses of the Parliament Big Ben is the nickname for the great bell of the clock at the Houses of Parliament in London.
1 3 When were men and women given the right to vote at the age of 21? 1928 In 1928, women were given the right to vote at the age of 21, the
@SMUsamaShah
SMUsamaShah / drag_select_all_link.js
Last active August 2, 2025 20:32
Bookmarklet to drag select and copy all the selected links from a page
@SMUsamaShah
SMUsamaShah / list_of_interesting_domains.md
Created June 11, 2025 13:11
List of interesting domains
  • abc.xyz (alphabet's corporate website)
  • 1e100.net (did you get it?)
  • n.pr (npr -- shortest possible domain?)
  • ai.dev (a shortcut to ai.studio.google)
  • computer.rip (a zine)
  • v0.dev (ui-generating ai)
  • 0.email (an email client with ai features)
  • near.by (a google platform for device connectivity)
  • le.ctu.re
  • sci.fi
@SMUsamaShah
SMUsamaShah / adb_daily_runtime.md
Created June 9, 2025 20:12
Android find total running time of an app today using adb

adb shell dumpsys usagestats can be used to get an app's usage stats.

For example, to get today's run time / usage of YouTube Kids app adb shell dumpsys usagestats com.google.android.youtube.tvkids | grep -A 5 "In-memory daily stats" | grep "totalTimeUsed" | sed 's/.*totalTimeUsed="\([^"]*\)".*/\1/' | awk -F: '{if(NF==2) print "00:" $0; else printf "%02d:%s\n", $1, substr($0, index($0,":")+1)}'

will return run time in HH:MM:SS format 00:00:32

@SMUsamaShah
SMUsamaShah / disable_google_tv_launcher.md
Created May 13, 2025 09:53
Disable Google Launcher on Android TV

If you are using Android TV Launcher,
$ adb shell pm uninstall --user 0 com.google.android.tvlauncher
If you are using GoogleTV Launcher,
$ adb shell pm uninstall --user 0 com.google.android.app.tv.launcherx

Source : https://www.tvusage.app/use-as-launcher

@SMUsamaShah
SMUsamaShah / visual_explainer_blogs.md
Last active September 24, 2025 21:52
Awesome Interactive Visual Explanation Blogs

There is a tiny amount of people who write amazing interactive articles explain a concept very visually, cleanly and with lots of detail. This is a list of those.

  1. https://ciechanow.ski/ (e.g. How Cylces Work, How watches work)
  2. https://samwho.dev/ (e.g. Reservoir sampling, Load balancing)
  3. https://imadr.me/pbr/ (physically based rendering)
@SMUsamaShah
SMUsamaShah / confluence.monospace.shortcut.user.js
Last active May 1, 2025 13:32
Confluence Monospace Keyboard Shortcut
// ==UserScript==
// @name Monospace Keyboard Shortcut for Confluence
// @version 0.8
// @grant none
// @include */editpage.action?*
// @include */createpage.action?*
// @include */resumedraft.action?*
// @run-at document-idle
// @description Adds keyboard shortcuts for formatting, Ctrl+Alt+m - monospace, Ctrl+Alt+j - superscript, Ctrl+Alt+k - subscript
// ==/UserScript==
@SMUsamaShah
SMUsamaShah / android_desktop_secondary_display.md
Last active April 26, 2025 11:34
Use Android phone like a computer, on your computer

(INCOMPLETE -- NOT FOUND A GOOD DESKTOP MODE PROCESS)

My Pixel phone does not support USB video output. Which means I can't connect my phone to my display via USB-to-HDMI (or any other) cable and expect it to work. Scrcpy supports Virtual Display and wireless connection now. Which means I can view my android in 1920x1080 on my monitor in desktop mode. And if installed Termux https://termux.dev/en/ I can use it like a Linux system that I always have in my pocket.

  1. Download scrcpy https://github.com/Genymobile/scrcpy and extract
  2. Open a terminal/cmd in scrcpy folder
  3. Establish a connection between your computer and android phone
docker run --rm -d -p 11470:11470 -p 12470:12470 -e NO_CORS=1 stremio/server:latest