Skip to content

Instantly share code, notes, and snippets.

View eritbh's full-sized avatar

Erin eritbh

View GitHub Profile

Dealing with Illustrator SVG Fonts

tldr: using specific save settings in illustrator and a script, we can generate an SVG file that uses embedded CSS web fonts and can have its text content edited dynamically (this just solves the font display problem, not the text alignment discrepancies introduced by the way text is layed out in the SVG, that will have to wait). Check it out - all the fonts in this processed SVG image show up just fine in Firefox and are being loaded from embedded data: URIs rather than system fonts.

image

This is how I'm saving my illustrator file:

image image

@eritbh
eritbh / wsl-vcxsrv-quickstart.md
Created January 19, 2022 02:32
Run desktop applications under WSL and display them with VcXsrv

First setup:

  • Install VcXsrv (https://sourceforge.net/projects/vcxsrv/)

  • Launch it (shows up in windows search as "XLaunch"), it will prompt you for some configuration

    • "Select display settings" sets how you want your WSL applications to be presented on the desktop, set these options however you like
    • "Select how to start clients" can be left at "Start no client"
    • On the "Extra settings" screen, tick "Disable access control" (or, if you don't trust your local network, have fun figuring out X authorities I guess)
    • Save your configuration to a file - this will be handy later

awaitButton.ts

A sample interaction awaiter that specifically only cares about button interactions with globally unique custom IDs.

Can be modified to respond differently to other conditions (i.e. only letting a specific user click the button, or handling other sorts of components). If that's what you want to do, you'll want to modify the buttons data structure to hold information about your custom conditions, and add logic within the interactionCreate listener to only call the associated resolver function when necessary.

This is a naive implementation, with several potential issues:

  • listening is a global variable, not directly associated with the client the listener is being added to (though you really shouldn't have multiple clients in your project anyway so it's probably fine)
  • Using an object for buttons means that only one person can listen for a specific customID at a time; this code will just overwrite the old listener if it's called a second time with the same ID, causing the ol
@eritbh
eritbh / resourcemon.lua
Created November 22, 2023 02:39
computercraft thingy
-- Aggregates status information for all peripherals connected to networked computers.
local pretty = require("cc.pretty")
local DISPLAY_REFRESH_DELAY = 0.1
local DATA_REFRESH_DELAY = 0.1
local BROADCAST_DELAY = 0.1
-- Connect to rednet on all modems
peripheral.find("modem", rednet.open)
@eritbh
eritbh / light-theme-font-weight-fix.css
Last active December 9, 2023 06:16
Discord theme - fix font weight for custom fonts in light theme
/* pulled 2023-12-09 */
@media all and (-webkit-max-device-pixel-ratio: 1) {
.theme-light .labelSelected__9ef94 {font-weight:400!important}
.theme-light .description__7af71 {font-weight:400!important}
.theme-light .filename_e129cd {font-weight:400!important}
.theme-light .markup_a7e664 {font-weight:400!important}
.theme-light .username_d30d99 {font-weight:500!important}
.theme-light .embedProvider_cfa718 {font-weight:400!important}
.theme-light .embedAuthorName_a1274b {font-weight:400!important}
.theme-light .embedDescription__33443 {font-weight:400!important}