Skip to content

Instantly share code, notes, and snippets.

View 2u841r's full-sized avatar

Zubair Ibn Zamir 2u841r

View GitHub Profile
@t3dotgg
t3dotgg / try-catch.ts
Last active April 1, 2025 07:47
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};

Uninstall Microsoft Edge

Important

Working on the latest supported Windows versions. Run Windows Update before following this guide.

1. Open Powershell > RUN AS ADMIN

2. Paste in irm https://gist.github.com/ave9858/c3451d9f452389ac7607c99d45edecc6/raw/UninstallEdge.ps1 | iex and press enter

3. Microsoft Edge will be completely uninstalled.

@teja156
teja156 / gist:8c35a05f43635da4cbd06b47c0d91e93
Last active March 28, 2025 07:14
Commands for deploying wordpress website on AWS EC2 shown in my YouTube video
YouTube video link: https://youtu.be/8Uofkq718n8
All the commands that are executed in the above youtube video are mentioned in this gist.
1. Install Apache server on Ubuntu
sudo apt install apache2
2. Install php runtime and php mysql connector
sudo apt install php libapache2-mod-php php-mysql
3. Install MySQL server
@matthewzring
matthewzring / markdown-text-101.md
Last active March 31, 2025 20:59
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@rambabusaravanan
rambabusaravanan / detect-js-framework.js
Last active March 7, 2025 20:19
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');