Skip to content

Instantly share code, notes, and snippets.

View oparisblue's full-sized avatar

Orlando Parisblue oparisblue

View GitHub Profile
@oparisblue
oparisblue / floodlight.css
Last active April 2, 2020 07:47
StackOverflow's "Ultra Dark" floodlight effect implementation
:root {
--cursorX:50vw;
--cursorY:50vh;
}
body.theme-ultradark:after {
content: '';
position: fixed;
display: block;
border-radius: 100%;
@oparisblue
oparisblue / command.sh
Created September 21, 2021 10:28
Force macOS to show FN keys on the touchbar when running Java programs
defaults write com.apple.touchbar.agent PresentationModePerApp -dict-add net.java.openjdk.cmd functionKeys
@oparisblue
oparisblue / AxisMovement.ts
Created July 12, 2022 08:29
Computing Movement along X/Y axies using TypeScript types
type Direction = "N" | "E" | "S" | "W";
type MovementAlongAxis<Path extends string, PosAxis extends Direction, NegAxis extends Direction, PosPart extends string = "", NegPart extends string = ""> =
Uppercase<Path> extends `${infer Movement extends Direction}${infer RemainingPath}` ? (
// If we're adding to the axis's value
Movement extends PosAxis ? (
NegPart extends "" ? (
// No negatives => add one to the positive part
MovementAlongAxis<RemainingPath, PosAxis, NegAxis, `0${PosPart}`, NegPart>
) : (