Skip to content

Instantly share code, notes, and snippets.

View Armster15's full-sized avatar
👋
~~waves~~

Armaan A Armster15

👋
~~waves~~
View GitHub Profile
import {
ElementRef,
ForwardRefExoticComponent,
createElement,
forwardRef,
} from "react";
import { cn } from "./utils";
export function extend<T extends { className?: string }>(
Component: ForwardRefExoticComponent<T>,
@aamiaa
aamiaa / RevertNewLayout.md
Last active June 27, 2024 20:26
Revert New Discord Layout

The original snippet no longer works!

On 02/09/2024 at around 8pm UTC, Discord flipped an experiment (2023-09_mobile_redesign_override_toggles) which ignores the layout toggle that this script relied on.

If you want to continue using the old layout, you can either use a modded mobile client (such as Vendetta) to disable that experiment, or downgrade to an old version of the app.

Method 1 - Downgrading (Android)

Tip

Use this one if you want a fast, beginner-friendly solution and don't mind using a version from November 2023

  1. Download version 205.15 of Discord mobile app from ApkMirror
import * as React from 'react';
const useIsFirstRender = (): boolean => {
const isFirst = React.useRef(true);
if (isFirst.current) {
isFirst.current = false;
return true;
} else {
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active June 27, 2024 07:41
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@Armster15
Armster15 / ApexLearningShowHideGrades.user.js
Created July 22, 2022 04:49
On a completed assessment, show and hide the answers so you can test your knowledge with completed quizzes. Great for preparing for bigger tests.
// ==UserScript==
// @name Apex Learning Show/Hide Assessment Grades
// @version 1.0.0
// @description On a completed assessment, show and hide the answers so you can test your knowledge with completed quizzes. Great for preparing for bigger tests.
// @author Armster15
// @license The Unlicense
// @match https://course.apexlearning.com/*
// @grant none
// @namespace https://gist.github.com/Armster15/d2e059575947558532983e9c6459581c
// @supportURL https://gist.github.com/Armster15/d2e059575947558532983e9c6459581c
@Armster15
Armster15 / RemoveOneNoteAnnotations.user.js
Last active May 22, 2022 20:25
A userscript for hiding OneNote drawing annotations with ease
// ==UserScript==
// @name Remove OneNote Annotations
// @version 1.0.0
// @description Need to hide drawing annotations in OneNote? This userscript is for you! It adds toggle buttons where you can hide/show the drawing annotations.
// @author Armster15
// @license The Unlicense
// @match https://usc-onenote.officeapps.live.com/*
// @icon https://i.imgur.com/84FaPib.png
// @grant none
// @namespace https://gist.github.com/Armster15/0c8941b3b9af6e55874f4e082c5dc714
@Armster15
Armster15 / AniList Stars to Smileys.user.js
Last active May 22, 2022 20:25
Converts the 5 star system to fire, smiley, meh, and frown icons, effectively creating a 4 point smiley system :)
// ==UserScript==
// @name AniList Stars to Smileys
// @version 1.0.0
// @description Converts the 5 star system to fire, smiley, meh, and frown icons
// @author Armster15
// @license The Unlicense
// @match https://anilist.co/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=anilist.co
// @grant none
// @namespace https://gist.github.com/Armster15/b82176835de0965485a72d64c0c09bac
@Armster15
Armster15 / AccessibleButton.tsx
Last active May 8, 2022 22:53
An unstyled React button with accessibility!
import React, { useState } from 'react';
import { useFocusVisibleListener } from '@react-aria/interactions';
import type { ButtonProps as HTMLButtonProps } from 'react-html-props';
export interface AccessibleButtonProps extends HTMLButtonProps {
/**
* Whether the button should lose it's focus when the mouse
* is released
* @default false
*/
@Armster15
Armster15 / GetDiscordTokenFromConsole.js
Last active June 3, 2024 23:55
A script that, when copypasted in the Discord console, it gives you your Discord token
/*
This allows you to get your Discord token via the Discord console.
Why this method?
- Simpler, just copy paste the function and call it, no need to monitor and manually look for headers
- More accurate
- More visually appealing
This code is licensed under The Unlicense. For more information please visit https://unlicense.org/

Module Workers Polyfill npm version

This is a 1.1kb polyfill for Module Workers.

It adds support for new Worker('..',{type:'module'}) to all modern browsers (those that support fetch).

Usage

Copy module-workers-polyfill.js to your web directory, then load it using an import or a script tag. It just needs to be loaded before instantiating your Worker.