Skip to content

Instantly share code, notes, and snippets.

:root {
--hue-shift: 0deg;
@include generateHSLCustomPropertiesFromColor('palette-black', #060606);
@include generateHSLCustomPropertiesFromColor('palette-green', #00bc8c);
@include generateHSLCustomPropertiesFromColor('palette-dark-grey', #313131);
@include generateHSLCustomPropertiesFromColor('palette-grey', #444444);
@include generateHSLCustomPropertiesFromColor('palette-red', #f00);
@include generateHSLCustomPropertiesFromColor('palette-white', #fff);
}
@trezy
trezy / _componentWithCutCorners.scss
Created January 13, 2023 15:03
Sass mixin that generates a `clip-path` polygon to simulate creates the pixelated, snipped corners.
.componentWithCutCorners {
background-color: red;
clip-path: generateCornerCutPath((
'borderSize': $panelBorderSize,
'clipSize': $panelCornerClipSize,
'isBorder': false,
'uiScale': var(--ui-scale),
));
display: block;
height: 100px;
import { EventSubMiddleware } from '@twurple/eventsub'
import Koa from 'koa'
import KoaRouter from 'koa-router'
const app = new Koa
const router = new KoaRouter
const middleware = new EventSubMiddleware('...')
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.fdgt.dev/PRIVMSG/generic.json",
"title": "PRIVMSG/generic",
"description": "",
"type": "object",
"properties": {
"command": {
"description": "The type of IRC command that was used to send this message.",
"pattern": "^(?:CLEARCHAT|CLEARMSG|GLOBALUSERSTATE|HOSTTARGET|JOIN|NICK|NOTICE|PART|PASS|PING|PONG|PRIVMSG|RECONNECT|ROOMSTATE|USERNOTICE|USERSTATE|WHISPER)$",
import { useStore } from './useStore.js'
export function GameUI() {
const {
isPaused,
pause,
play,
} = useStore(state => ({
isPaused: state.isPaused,
pause: state.pause,
{
"success": 1,
"code": "OK",
"msg": "OK",
"data": {
"rowcount": 1,
"totalrows": 1,
"estimatedrows": false,
"pagesize": 0,
"pagecount": null,
{
"success": 1,
"code": "OK",
"msg": "OK",
"data": {
"config": {
"nearPlane": 2,
"farPlane": 12345,
"stars": {
"useStarFading": true,
/**
* Add all items in an array of numbers.
*/
function addArray(array) {
return array.reduce((a, b) => a + b)
}
/**
* Calculate total stats (keyed by category), then generate
* additional meta stats based on initial calculations.
@trezy
trezy / reduceVersion1.js
Created June 21, 2022 16:02
Evaluating 2 versions of a JavaScript `array.reduce`
const valueArrays = [
[1, 2],
[100, 400, 700],
]
const TOTAL_COMBINATIONS = valueArrays
.reduce((accumulator, values, index) => {
if (index === 0) {
return values.length
}
@trezy
trezy / twinkle-twinkle-little-star.json
Created May 5, 2022 16:15
This is the first 4 bars of "Twinkle Twinkle Little Star" written in JSONg, which can be played with the emulator here: https://codepen.io/trezy/full/eYZGxXY
[
[
["C3"],
[4, "C2", "E2", "G2"]
],
[["C3"]],
[["G3"]],
[["G3"]],
[