Skip to content

Instantly share code, notes, and snippets.

View RazerMoon's full-sized avatar
🐢
Slowly getting there...

Rasync RazerMoon

🐢
Slowly getting there...
  • Ireland
View GitHub Profile

Keybase proof

I hereby claim:

  • I am RazerMoon on github.
  • I am razermoon (https://keybase.io/razermoon) on keybase.
  • I have a public key whose fingerprint is C2C1 69E9 5ACF D1E1 539D 3205 C825 571D 6440 A36D

To claim this, I am signing this object:

@RazerMoon
RazerMoon / rgb.js
Created April 18, 2020 03:54
Change RGB values of username text
let usernames = document.querySelectorAll(".username-1A8OIy")
for (let i = 0; i < usernames.length; i++) {
let rgb = usernames[i].style.color
if (rgb == 0) continue;
rgb = rgb.replace(/[^\d,]/g, '').split(',').map(Number);
let maxValue = Math.max(rgb[0], rgb[1], rgb[2])
@RazerMoon
RazerMoon / membername.css
Last active April 23, 2020 13:39
Gets rid of the roles and names in the member list, leaving only the avatars.
/* Member List Name Hider Snippet */
/* by RazerMoon/Rasync */
.da-membersGroup {
display: none; /* Hides Roles */
}
.da-layout > .da-content {
display: none; /* Hides names */
}
@RazerMoon
RazerMoon / webcam.css
Created April 23, 2020 13:58
Changes the size of the webcam preview window in settings, because it is hella small by default.
/* Webcam Size Changer Snippet */
/* By RazerMoon */
.userSettingsVoice-iwdUCU .media-engine-video {
height: 405px !important;
width: 720px !important;
}
.userSettingsVoice-iwdUCU .previewContainer-37c2Si {
position: relative;
@RazerMoon
RazerMoon / nitrobegone.css
Last active April 24, 2020 19:49
Gets rid of the Discord Nitro tab in settings
/* Discord Nitro Tab be gone */
/* By RazerMoon*/
.da-item:not(.da-themed):not(span):not(.da-clickable) {
display: none;
}
@RazerMoon
RazerMoon / userPopouts.css
Created April 29, 2020 01:08
Adds a background to user popouts
/* User Popout Background Adder Snippet*/
/* By RazerMoon */
.da-userPopout {
background: url(https://live.staticflickr.com/8004/7668739916_179a085784_b.jpg) center top;
background-size: 300px 550px;
}
.da-userPopout .da-headerNormal {
background-color: rgba(100,100,100,0.5);
@RazerMoon
RazerMoon / setState.ts
Created November 15, 2020 18:37
Basic visualization of how React useState works (passing parameters to a callback function) (useful for custom hooks)
// https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABDAzgMXNeYAUpKwIAqcAwgBYCmEA1gFyLg1hwDuYAlIgN4BQiAxACdKUEEKT4sxMlVqIAZAp4BfAHRQ4AZShCYYAOZqIAQwA2ZvJkJgSFajS4BeF4gDkAbTgAjAFbUoRAwCbABdNwBuXhVeXjNRRAhxETAoHRMoSgYTMABPKN4pG0QAfRRRdMycMEpWADVzECzEHNyuPkFkYEQcVGDpXBr6xsoOdv5OwSShFLSoDMpEJ0QhhrMmnGnZytGJgRVESjNynj3JrcpUnaWV2rWms5iYwutsRnKdgB4tAD5esBgsHM92aWnGnQuV3mmRu+kBMGBI1inREYgkiA8kLmCwANKVytjMqEWihEggUFBorEIOTAh4KbjEASdsTliAPtDKHhzOUOLFmZycDgAA4iABuDG8cDg8Ryzh+iAAhKLKGK+bwaWAUDLKGozHADJtkpdCaNEAB6c2ITRwRBmEwAL1y1ttAFsTDRFgyYaw4EIaIhvCBArk4CBEAYElAqMgACaUExAA
function isFunction(functionToCheck: unknown) {
return functionToCheck && {}.toString.call(functionToCheck) === '[object Function]';
}
let currentState: any;
function _setState(newValue: any) {
if (isFunction(newValue)) {
@RazerMoon
RazerMoon / earnings.js
Created December 10, 2020 21:43
Uses a very simple calculation to determine a Patreon user's/campaign's earnings and logs it to console
// I personally use this as a snippet and run it after the patreon page loads
// Note: There is a severe lack of error checking present in this, but it works for most pages that hide the earnings (that I have tried)
let {data, included} = patreon.bootstrap.campaign;
let {patron_count} = data.attributes;
let rewards = included.filter(({type, id, attributes}) => {return (type && type === "reward" && id > 0) ? true : false;}).map(({attributes}) => attributes.amount_cents / 100);
if (patron_count) {
//console.log(patron_count);
@RazerMoon
RazerMoon / 0_fix.md
Last active February 11, 2021 11:26
Stop GitHub Repository from being ugly / get rid of wide header

Check out stylebot extension to apply css everytime you visit a page

#js-repo-pjax-container {
  max-width: 1280px;
  margin: auto;
}
#include "Joystick.h"
// https://github.com/MHeironimus/ArduinoJoystickLibrary
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,
JOYSTICK_TYPE_GAMEPAD, 0, 0, // first no. is how many button there are
false , false, false, false, false, false,
true, true, false, false, false);