Skip to content

Instantly share code, notes, and snippets.

View aswnss-m's full-sized avatar
🌎
Working

Aswin Lal M aswnss-m

🌎
Working
View GitHub Profile
@aswnss-m
aswnss-m / tryCatch.ts
Created November 10, 2025 08:49
Better try catch which can handle async function as well. Picked from theo's trycatch gist
// Define the success/failure tuple types
export type OperationSuccess<T> = readonly [data: T, error: null];
export type OperationFailure<E> = readonly [data: null, error: E];
export type OperationResult<T, E> = OperationSuccess<T> | OperationFailure<E>;
// Define the allowed operation types
/**
* Checks if the value is a Promise or "Thenable"
* @param value - The value to check
* @returns True if the value is a Promise, false otherwise
@aswnss-m
aswnss-m / android_screen_sizes.js
Last active March 17, 2026 20:46
Android Device Screen Resolutions & Viewport Sizes (2025-2026)
const Android = {
"Samsung Galaxy A12": {
"width": 720,
"height": 1600
},
"Samsung Galaxy A13": {
"width": 1080,
"height": 2408
},
"Samsung Galaxy A13 5G": {
@aswnss-m
aswnss-m / iphone_screen_sizes.js
Last active March 17, 2026 21:09
Iphone Screen Resolutions & Viewport Sizes (2025-2026)
const Iphone = {
"17 pro max": {
width: 1320,
height: 2868,
},
"17 pro": {
width: 1206,
height: 2622,
},
"17": {