Sign in

Muhammad Khan

@muhammadkhan.dev
76 followers 109 following 158 posts

Despite being terribly unreasonable, I like to think of myself as rational & practical. He/Him 📍 Lahore, Pakistan

PostsRepliesMedia
Muhammad Khan @muhammadkhan.dev · 13/06/2025
I just released a new publicly available API This API bridges that gap. - Programmatic access to SBP daily weighted average buying rates (in JSON format) - Updated daily at 4:00 PM PKT (excluding Bank Holidays) - Built with FastAPI Try it out: sbp-war-api.muhammadkhan.dev/docs
sbp-war-api.muhammadkhan.dev
FastAPI - Swagger UI
112
Muhammad Khan @muhammadkhan.dev · 07/05/2025
"Never think that war, no matter how necessary, nor how justified, is not a crime." ~ Ernest Hemingway

I wish for calmer heads to prevail.
010
Muhammad Khan @muhammadkhan.dev · 19/03/2025
www.citationneeded.news/free-and-ope...
citationneeded.news
“Wait, not like that”: Free and open access in the age of generative AI
The real threat isn’t AI using open knowledge — it’s AI companies killing the projects that make knowledge free
020
Muhammad Khan @muhammadkhan.dev · 16/02/2025
Just ran a 5k. Not gonna lie, 50% of my motivation came just from seeing all these tech people running marathons. Do I get to join the cool kids club now?
Me holding a medal for finishing a 5K run, in front of a banner saying "I am a finisher"
020
Muhammad Khan @muhammadkhan.dev · 13/02/2025
Standing strong for equality and justice at Aurat March in Lahore. 💜✊🏽 Equality should never be up for debate. #AuratMarch #EqualityForAll
My sister and I holding placards during Aurat March in Lahore.

The signs are written in Urdu. My sister is holding a sign that says: "Izzat nahi, jaan bachao", which means "Save lives not honour" I am holding a sign that says: "Ziyada soch mat bas barabar samajh", which means "Don't think too much, just think of all as equals".
020
Reposted by Muhammad Khan
George Takei @georgetakei.bsky.social · 31/01/2025
This is what the government did with 120K+ Japanese Americans in 1942. I know. I was there in those camps.
34549891531616
Reposted by Muhammad Khan
John Scalzi @scalzi.com · 29/01/2025
OpenAI right now
Scene from The Princess Bride where Vizzinni says "You're trying to kidnap what I've rightfully stolen"
287435396257
Muhammad Khan @muhammadkhan.dev · 24/01/2025
A bit of old news but this screenshot shows the reason why I switched banks. This is like a textbook answer to the question, "Tell me you are storing passwords in plaintext without telling me you are using passwords in plaintext"
A screenshot of the login page from the web portal of Askari Bank Pakistan is attached.

The text reads: "Please enter 1st, 3rd, 7th and 8th characters of your password."
010
Muhammad Khan @muhammadkhan.dev · 23/01/2025
🧹 Clean up your cluttered git workspaces by removing all stale merged branches ⚠️ No warranty for important branches you forgot to name properly! If you called it fix-final-final-really-final, that one's on you.
# Remove all merged branches from local except main, prod and dev
git branch --merged | grep -Ev "(^\*|^\+|main|prod|dev)" | xargs --no-run-if-empty git branch -d

# Get rid of remote tracking branches
git remote prune origin
020
Muhammad Khan @muhammadkhan.dev · 10/01/2025
www.chess.com/awards/muham... Yay, 1500 by end of 2025 is suddenly not looking like an insurmountable task.
Stat card showing 1203 Rapid Rating on Chess.com.
020
Reposted by Muhammad Khan
Molly White @molly.wiki · 08/01/2025
any billionaire buying Wikipedia would be a tragedy, "on the good side" or not. we need to stop divvying up all the important institutions along billionaires and then relying on their good graces — look how it's gone so far.
13973451257
Muhammad Khan @muhammadkhan.dev · 07/01/2025
getfreewrite.com/blogs/writin...
getfreewrite.com
What Does the World Lose When a Language Dies?
Every 40 days, another one dies — becoming extinct forever. By the year 2100, that will be 3,500 lost. We’re not talking about a species of animal, or variety of plant. We’re talking about languages —...
010
Muhammad Khan @muhammadkhan.dev · 01/01/2025
Wow, great start to 2025. Hoping to reach 1500+ by end of this year
Screenshot of Unlocked Achievement on Chess.com for reaching a rating of 1100 in Rapid Chess
000
Reposted by Muhammad Khan
Erik Rasmussen @erikras.com · 30/12/2024
Works.
49715
Muhammad Khan @muhammadkhan.dev · 22/12/2024
I've completed Day 22 of Advent of TypeScript 2024. Toughest one yet, I am already dreading, what's going to be tomorrow. adventofts.com/events/2024/22
https://tsplay.dev/N7DxDm
020
Muhammad Khan @muhammadkhan.dev · 21/12/2024
I've completed Day 21 of Advent of TypeScript 2024 So is every day going to be a variation of this now? :) adventofts.com/events/2024/21
030
Muhammad Khan @muhammadkhan.dev · 21/12/2024
Day [21] ✅ I got the Yeti one step closer to home at DebugDecember.com #DebugDecember
debugdecember.com
Debug December
Help the Yeti get home. Play Debug December and win cool prizes.
000
Muhammad Khan @muhammadkhan.dev · 20/12/2024
I've completed Day 20th of Advent of TypeScript 2024 adventofts.com/events/2024/20
type TRes = {
	declared: string[];
	used: string[];
};

type ParseStatement<T extends string, TResult extends TRes> = T extends `${string}${
	| "let"
	| "const"
	| "var"} ${infer TId extends string} =${string}`
	? {
			declared: [...TResult["declared"], TId];
			used: TResult["used"];
		}
	: T extends `${string}(${infer TId extends string})${string}`
		? {
				used: [...TResult["used"], TId];
				declared: TResult["declared"];
			}
		: TResult;

type AnalyzeScope<
	T extends string,
	TResult extends TRes = {
		declared: [];
		used: [];
	},
> = T extends `${infer TFirst};${infer TSecond}`
	? AnalyzeScope<TSecond, ParseStatement<TFirst, TResult>>
	: ParseStatement<T, TResult>;
030
Muhammad Khan @muhammadkhan.dev · 19/12/2024
I've completed Day 19 of Advent of TypeScript 2024. adventofts.com/events/2024/19
030
Reposted by Muhammad Khan
Cassidy @cassidoo.co · 19/12/2024
Me looking at some older code arrogantly before I do a git blame and realize I was the one who wrote it
A cat looking menacing with the word "pathetic" at the bottom.
1030522
Muhammad Khan @muhammadkhan.dev · 18/12/2024
I've completed Day 18th of Advent of TypeScript 2024. adventofts.com/events/2024/18
110
Muhammad Khan @muhammadkhan.dev · 18/12/2024
Day [18] ✅ DebugDecember.com I really like this one; it feels more practical than other advent calendars. #DebugDecember
debugdecember.com
Debug December
Help the Yeti get home. Play Debug December and win cool prizes.
010
Reposted by Muhammad Khan
edith @edithcharles.bsky.social · 17/12/2024
You know, I'm something of an ex male myself
Norman Osborne with a trans flag behind him
2287701473
Muhammad Khan @muhammadkhan.dev · 17/12/2024
I've completed Day 17th of Advent of TypeScript 2024. adventofts.com/events/2024/17
export const upperCase = <T extends string>(x: T) => x.toUpperCase() as Uppercase<T>;
export const lowerCase = <T extends string>(x: T) => x.toLowerCase() as Lowercase<T>;
export const firstChar = <T extends string>(x: T) =>
	x[0] as T extends `${infer TFirst}${infer _}` ? TFirst : never;
export const firstItem = <T extends string[]>(x: T) => x[0] as T[0];
export const makeTuple = <T extends string>(x: T) => [x] as [T];
export const makeBox = <T>(value: T) => ({ value });

type TFunc<T1, T2> = (x: T1) => T2;

export const compose = <T1, T2, T3, T4>(f: TFunc<T1, T2>, g: TFunc<T2, T3>, h: TFunc<T3, T4>) => {
	return (x: T1) => {
		return h(g(f(x))) as T4;
	};
};
150
Muhammad Khan @muhammadkhan.dev · 16/12/2024
I've completed Day 16th of Advent of TypeScript 2024 adventofts.com/events/2024/16
type RemoveFromTuple<Tuple extends any[], SubTuple extends any[]> = Tuple extends [
	...SubTuple,
	...infer TRest,
]
	? TRest
	: never;

type TCurriedFun<TArgs extends any[], TReturn> = <TCurrentArgs extends any[]>(
	...args: TCurrentArgs
) => RemoveFromTuple<TArgs, TCurrentArgs>["length"] extends 0
	? TReturn
	: TCurriedFun<RemoveFromTuple<TArgs, TCurrentArgs>, TReturn>;

declare function DynamicParamsCurrying<TArgs extends any[], TReturn>(
	fun: (...arg: TArgs) => TReturn,
): TCurriedFun<TArgs, TReturn>;
020
Muhammad Khan @muhammadkhan.dev · 15/12/2024
I've completed Jet Fuel Pricing - Advent of TypeScript 2024 adventofts.com/events/2024/15
export type GetRoute<
	T extends string,
	TDashes extends string[] = [],
	TRoute extends [string, number][] = [],
	TWord extends string = "",
> = T extends ${infer F}${infer R}
	? F extends "-"
		? GetRoute<
				R,
				TRoute extends []
					? TWord extends ""
						? []
						: ["-"]
					: TWord extends ""
						? [F, ...TDashes]
						: ["-"],
				TWord extends "" ? TRoute : [...TRoute, [TWord, TDashes["length"]]],
				""
			>
		: GetRoute<R, TDashes, TRoute, ${TWord}${F}>
	: TWord extends ""
		? TRoute
		: [...TRoute, [TWord, TDashes["length"]]];
080
Reposted by Muhammad Khan
Molly White @molly.wiki · 14/12/2024
strong BlueSky endorsement from crypto media outlet Cointelegraph
At the time of publication, however, a simple search for “crypto” on BlueSky tended to show posts comparing digital asset projects to scams, while the same results on X showed crypto-positive memes first.

Screenshots of a search for "crypto" on Bluesky returning a post by George Conway: "'A crypto venture recently unveiled by U.S. President-elect Donald Trump and his new Middle East envoy, billionaire Steve Witkoff, has partnered with a crypto platform that authorities … say has been used by criminals and Iran-backed militant groups Hamas and Hezbollah.'"

Screenshots of a search for "crypto" on Twitter returning a post by Gordon: "Me at Christmas dinner sitting across my uncle who told me crypto was a scam", with a photo of a sports fan shouting
20787114
Muhammad Khan @muhammadkhan.dev · 14/12/2024
I've completed Day 14th of Advent of TypeScript 2024. Surprisingly easy compared to last two days. adventofts.com/events/2024/14
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
010
Reposted by Muhammad Khan
luna @imlunahey.com · 13/12/2024
i’ve had to explain this multiple times. just because more people look at the content doesn’t mean it’s good content. spam also gets seen a lot. the one sentence thing people do is just annoying. not gonna lie. i’ve blocked people over this.
6182
Muhammad Khan @muhammadkhan.dev · 13/12/2024
I've completed The Reindeer Plan Their Attack - Advent of TypeScript 2024 I was not expecting this to lead me to the places that it did. adventofts.com/events/2024/13
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
010
Muhammad Khan @muhammadkhan.dev · 12/12/2024
I've completed 🎩Bernard's Long List Of Names - Advent of TypeScript 2024 adventofts.com/events/2024/12
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
030
Muhammad Khan @muhammadkhan.dev · 11/12/2024
I just completed "Plutonian Pebbles" - Day 11 - Advent of Code 2024 This is a rare case where I feel that my solution is quite presentable. github.com/MBM1607/adve... #AdventOfCode
Code Available at: https://github.com/MBM1607/advent-of-code-2024/blob/main/src/day-11-plutonian-pebbles/plutonian-pebbles.ts
020
Muhammad Khan @muhammadkhan.dev · 10/12/2024
I just completed "Hoof It" - Day 10 - Advent of Code 2024 #AdventOfCode github.com/MBM1607/adve...
github.com
advent-of-code-2024/src/day-10-hoof-it at main · MBM1607/advent-of-code-2024
My solutions to the Advent of Code 2024 puzzles. Contribute to MBM1607/advent-of-code-2024 development by creating an account on GitHub.
020
Muhammad Khan @muhammadkhan.dev · 10/12/2024
I've completed The Reindeer Hatch A Plan - Advent of TypeScript 2024 adventofts.com/events/2024/10
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
010
Reposted by Muhammad Khan
Cassidy @cassidoo.co · 09/12/2024
I've got a fresh newsletter issue off the presses and headed to your inbox! 🗞️ Come read some great articles, a roundup of my #blogvent posts so far, a holiday-themed practice interview question, and of course, a joke: cassidoo.co/newsletter
cassidoo.co
rendezvous with cassidoo
A weekly newsletter with web development content for everyone, from beginners to pros.
6387
Muhammad Khan @muhammadkhan.dev · 09/12/2024
I've completed 🌟Vixen Confronts 🪩Jamie - Advent of TypeScript 2024 adventofts.com/events/2024/9
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
010
Muhammad Khan @muhammadkhan.dev · 07/12/2024
I just completed "Bridge Repair" - Day 7 - Advent of Code 2024 #AdventOfCode github.com/MBM1607/adve...
github.com
advent-of-code-2024/src/day-7-bridge-repair at main · MBM1607/advent-of-code-2024
My solutions to the Advent of Code 2024 puzzles. Contribute to MBM1607/advent-of-code-2024 development by creating an account on GitHub.
020
Muhammad Khan @muhammadkhan.dev · 07/12/2024
I just completed "Guard Gallivant" - Day 6 - Advent of Code 2024 #AdventOfCode github.com/MBM1607/adve...
github.com
advent-of-code-2024/src/day-6-guard-gallivant at main · MBM1607/advent-of-code-2024
My solutions to the Advent of Code 2024 puzzles. Contribute to MBM1607/advent-of-code-2024 development by creating an account on GitHub.
000
Muhammad Khan @muhammadkhan.dev · 05/12/2024
I just completed "Print Queue" - Day 5 - Advent of Code 2024 #AdventOfCode github.com/MBM1607/adve...
github.com
advent-of-code-2024/src/day-5-print-queue at main · MBM1607/advent-of-code-2024
My solutions to the Advent of Code 2024 puzzles. Contribute to MBM1607/advent-of-code-2024 development by creating an account on GitHub.
020
Muhammad Khan @muhammadkhan.dev · 05/12/2024
I've completed Drafting This Year's Routes - Advent of TypeScript 2024 adventofts.com/events/2024/5
010
Reposted by Muhammad Khan
Ryan Cavanaugh @searyanc.dev · 04/12/2024
Three kinds of people 1. Those who cannot do Advent of Code entirely in the TypeScript type system 2. Those who can, but refuse to on principle 3. Those who can and will You really want the middle group on your team
2122
Muhammad Khan @muhammadkhan.dev · 04/12/2024
github.com/MBM1607/adve... I just completed "Ceres Search" - Day 4 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/4
github.com
advent-of-code-2024/src/day-4-ceres-search at main · MBM1607/advent-of-code-2024
My solutions to the Advent of Code 2024 puzzles. Contribute to MBM1607/advent-of-code-2024 development by creating an account on GitHub.
010
Muhammad Khan @muhammadkhan.dev · 03/12/2024
How do you folks write Alt Text on Code Snippets. I usually alternate between just writing the code if it's short enough or linking the GitHub file link with text like "Code Snippet, read at: <link>". I am curious to hear from those using screen readers as to which they prefer.
031
Muhammad Khan @muhammadkhan.dev · 03/12/2024
I just completed "Mull It Over" - Day 3 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/3
000
Muhammad Khan @muhammadkhan.dev · 03/12/2024
I've completed 🎅Santa Wants Housing Data - Advent of TypeScript 2024 adventofts.com/events/2024/3
020
Muhammad Khan @muhammadkhan.dev · 02/12/2024
I just completed "Red-Nosed Reports" - Day 2 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/2
010
Muhammad Khan @muhammadkhan.dev · 02/12/2024
I just completed "Historian Hysteria" - Day 1 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/1
010
Muhammad Khan @muhammadkhan.dev · 01/12/2024
I've completed The Reindeer Have Had Enough - Advent of TypeScript 2024 adventofts.com/events/2024/1
130
Reposted by Muhammad Khan
Andy H 🇬🇧🇺🇦💜 @wh-y.bsky.social · 26/11/2024
Morning world HAPPY TUESDAY! Have a flippin fantastically fun day.
5192
Reposted by Muhammad Khan
George Takei @georgetakei.bsky.social · 24/11/2024
Make it make sense.
6664500579