Skip to content

Instantly share code, notes, and snippets.

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

Armaan A Armster15

👋
~~waves~~
View GitHub Profile
@Armster15
Armster15 / use-media-recorder.ts
Last active June 10, 2024 05:30
A lightweight React hook for the `MediaRecorder` API that stays out of your way and makes it easy to record audio
import { useRef } from "react";
const ALL_MEDIA_RECORDER_EVENTS = [
"dataavailable",
"error",
"pause",
"resume",
"start",
"stop",
];
@Armster15
Armster15 / flask_rate_limits.py
Created January 11, 2024 00:14
Flask app with rate limits
from flask import Flask, jsonify
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
app = Flask(__name__)
# Configure rate limiting with in-memory storage
limiter = Limiter(
get_remote_address,
app=app,
@Armster15
Armster15 / GooglePeriodicTableSearch.user.js
Last active July 30, 2022 05:41
Userscript that adds a search function to Google's periodic table
// ==UserScript==
// @name Google Periodic Table Search Function
// @version 1.0.0
// @description Adds a search function to Google's periodic table
// @author Armster15
// @match https://www.google.com/search?*
// @match https://www.google.com/search/?*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant none
// @namespace https://gist.github.com/Armster15/365487549125f1825c5d5219d8486ace
@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 / Emoji.tsx
Last active May 24, 2022 07:28
An emoji component for React that has accessibility and Twemoji support!
import React, { useRef, useEffect } from "react";
import { SpanPropsWithoutRef } from "react-html-props";
import assert from "assert";
import twemoji from "twemoji";
export interface EmojiProps extends SpanPropsWithoutRef {
symbol: string;
}
export const Emoji = ({ symbol, "aria-label": ariaLabel, ...props }: EmojiProps) => {
@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/
@Armster15
Armster15 / TwemojiTutorial.html
Last active September 3, 2023 05:15
A simple HTML example on how to use Twemojis in your website!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Twemoji Tutorial</title>
<!-- This retrieves the latest Twemoji script -->
<script src="https://twemoji.maxcdn.com/v/latest/twemoji.min.js" crossorigin="anonymous"></script>