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
@RazerMoon
RazerMoon / README.md
Last active July 26, 2021 20:21
GIMP drop shadow windows

Inspired by this.

Tutorial

  • Take script from below and put it in C:\Users\<your name>\AppData\Roaming\GIMP\<version you're using>\scripts.
  • Open cmd and cd to where your image is.
  • Run this command:
    • "C:\Users\<your name>\AppData\Local\Programs\GIMP 2\bin\gimp-console-<version>.exe" -b "(report-drop-shadow \"<name of infile>\" \"<name of outfile>\" 0 0 30 60 TRUE)" -b "(gimp-quit 0)"

Adjust settings to your liking.

@RazerMoon
RazerMoon / controller.c
Created June 26, 2021 20:57
FSX custom throttle
#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);
@RazerMoon
RazerMoon / deepDiffMapper.js
Created May 23, 2021 17:29
Difference between two objects
// ? Taken from https://stackoverflow.com/questions/8572826/generic-deep-diff-between-two-objects but changed to only return changes.
// ! DO NOT USE IN PRODUCTION, UNTESTED AND LIKELY UNSTABLE
const deepDiffMapper = (function () {
return {
VALUE_CREATED: "created",
VALUE_UPDATED: "updated",
VALUE_DELETED: "deleted",
VALUE_UNCHANGED: "unchanged",
map: function (obj1, obj2) {
if (this.isFunction(obj1) || this.isFunction(obj2)) {
@RazerMoon
RazerMoon / log.js
Created March 26, 2021 19:44
Log all BDD plugins
// Go to "Plugins" page in settings, then run:
document.querySelectorAll(".bda-header").forEach((item) => {console.log(item.textContent)})
@RazerMoon
RazerMoon / cloudSettings
Last active September 24, 2021 09:01
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-03-02T20:34:19.675Z","extensionVersion":"v3.4.3"}
#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);
@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;
}
@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 / 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 / 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);