Skip to content

Instantly share code, notes, and snippets.

View LizAinslie's full-sized avatar
⚒️
BUILD COOL SHIT BUILD COOL SHIT BUILD COOL SHIT

Liz Ainslie LizAinslie

⚒️
BUILD COOL SHIT BUILD COOL SHIT BUILD COOL SHIT
View GitHub Profile
// Define a trait function to that expects behavior to convert a value to type T
trait fun to<T>(): T
// So you want to require a property? Use a trait getter!
trait fun(get) displayName: String
// You can define a tuple type with parenthesis
tuple Name (String, String) {
|(first, last)| impl fun to<String>() = "${first} ${last}"
@LizAinslie
LizAinslie / stacky.ts
Last active January 27, 2024 04:07
Stacky bois
const stackCount = 10
const STACK_SPACE = 10;
// Draw the stack of images
for (let i = 0; i < stackCount; i++) {
const shearFactor = (stackCount - i)
// Calculate scale and position adjustments based on the current iteration
const scaleAdjustment = 0.9 + (0.1 * (i - shearFactor)) / stackCount
const positionAdjustmentX = (scaledImageWidth - (scaledImageWidth * scaleAdjustment)) / 2;
const positionAdjustmentY = (STACK_SPACE * shearFactor);
@LizAinslie
LizAinslie / README.md
Last active December 19, 2024 18:38
A beautiful discord/vencord dev build setup fish function script I wrote for my Arch install.

update_discord.fish

A cheerful & colorful Fish function I wrote to keep my Discord and Vencord installations up to date on my Arch machine.

update_discord help text

This function assumes that you have the following installed:

  • git
  • node
  • pnpm
  • wget
@LizAinslie
LizAinslie / exposed_kotlin_uuid.kt
Last active February 25, 2025 00:32
Use kotlin.uuid.Uuid as an index in Exposed, instead of java.util.UUID
@file:OptIn(ExperimentalUuidApi::class)
import org.jetbrains.exposed.dao.Entity
import org.jetbrains.exposed.dao.EntityClass
import org.jetbrains.exposed.dao.id.EntityID
import org.jetbrains.exposed.dao.id.IdTable
import org.jetbrains.exposed.sql.Column
import org.jetbrains.exposed.sql.ColumnType
import org.jetbrains.exposed.sql.Table
import org.jetbrains.exposed.sql.Table.Dual.clientDefault