Skip to content

Instantly share code, notes, and snippets.

View nicholastay's full-sized avatar

Nicholas Tay nicholastay

View GitHub Profile
@nicholastay
nicholastay / mumapbooster.user.js
Last active November 4, 2022 10:38
MUMapBooster - Adds location to Monash Maps (https://maps.monash.edu) searches to improve relevance of results
// ==UserScript==
// @name Monash Maps location search booster
// @namespace nick.tay.blue
// @match https://maps.monash.edu/
// @grant none
// @version 0.1.2
// @author Nicholas Tay <[email protected]>
// @description Adds location as context to the MazeMap API before searching to improve relevance of searches
// ==/UserScript==
@nicholastay
nicholastay / aoc-2022.js
Last active December 4, 2022 03:33
AOC 2022 random js attempts for fun
// Day 1 Part 1
Math.max(...input.split('\n').reduce((acc, val) => (val === '' ? [...acc, 0] : (acc.slice(0, -1).concat(acc[acc.length-1] + Number(val)))), [0]));
// Day 1 Part 2
new Int32Array(input.split('\n').reduce((acc, val) => (val === '' ? [...acc, 0] : (acc.slice(0, -1).concat(acc[acc.length-1] + Number(val)))), [0])).sort().slice(-3).reduce((a, b) => a + b);
// Day 2 Part 1
input
.split('\n')
.map(x => [x[2].charCodeAt(0)-88, x[0].charCodeAt(0)-65])
.reduce((acc, [hand, opp]) => (acc + hand+1 + ((hand === opp) ? 3 : (((opp + 1) % 3 === hand) ? 6 : 0))), 0);
@nicholastay
nicholastay / winterm_tokyonight.json
Created December 7, 2022 07:08
Tokyo Night (Night variant) - Windows Terminal
{
"background": "#1A1B26",
"black": "#15161E",
"blue": "#7AA2F7",
"brightBlack": "#414868",
"brightBlue": "#7AA2F7",
"brightCyan": "#7DCFFF",
"brightGreen": "#9ECE6A",
"brightPurple": "#BB9AF7",
"brightRed": "#F7768E",
@nicholastay
nicholastay / nyaa-magnet.user.js
Created June 27, 2023 08:58
Copy all visible magnets on nyaa
// ==UserScript==
// @name nyaa copy all magnets
// @namespace nick.tay.blue
// @match https://nyaa.si/*
// @grant none
// @version 0.1.0
// @author Nicholas Tay <[email protected]>
// @description Copy all visible magnet links from results page
// ==/UserScript==