dysbulic 🐙
dysbulic 🐙
KPCKevin Powell - Community
Created by dysbulic 🐙 on 7/2/2024 in #front-end
What are the dangers of allowing a user to specify a stylesheet?
Doing custom props requires me to structure the page and figure out all the ways a user might want to alter the appearance. Say they want a border radius of 5% on the header & 2rem on the body elements. With CSS they can do that pretty readily (if I use a coherent semantic markup), if I'm defining all the props, I'll need separate ones for each different location. For me to create a structure that matches the natural expressiveness of CSS is pretty much impossible.
5 replies
KPCKevin Powell - Community
Created by Rio200 on 7/2/2024 in #front-end
Looking for New Animation Ideas!
I was helping someone write this for this site today. It takes a SVG image, parses it, extracts the components, & causes them to appear one at a time using <animate> tags with a begin value of [previous element id].end. SMIL animations using <animate> tags actually has a reasonably complex events and interaction model.
4 replies
KPCKevin Powell - Community
Created by Nekorin on 7/2/2024 in #front-end
Any ideas on how to create a double border chamfer with transparent background?
If you can do the cut corners, double is a valid border-style.
7 replies
KPCKevin Powell - Community
Created by thethingisback on 6/30/2024 in #front-end
Converting .png to .svg 'trace-bitmap', coming out bubbled/soft edges, advice
Are you kidding? It got the gradient which was what impressed me. I'll admit you could remove 80% of the points, but if you wanted to do that you could likely remove them in less time than it would take to draw it.
20 replies
KPCKevin Powell - Community
Created by thethingisback on 6/30/2024 in #front-end
Converting .png to .svg 'trace-bitmap', coming out bubbled/soft edges, advice
No description
20 replies
KPCKevin Powell - Community
Created by thethingisback on 6/30/2024 in #front-end
Converting .png to .svg 'trace-bitmap', coming out bubbled/soft edges, advice
Recraft did a reasonably good job of vectorizing — handled a gradient properly & didn't generate a ton of points. Even that though, I had to go through and do some manual cleaning.
20 replies
KPCKevin Powell - Community
Created by Vern on 6/27/2024 in #os-and-tools
Google Search Console Errors
Unfortunately, some folx on this Discord have a philosophical aversion to Discord's reply function. 😸 (It's been discussed.)
30 replies
KPCKevin Powell - Community
Created by GHOST 👻 on 6/26/2024 in #os-and-tools
Npm Errors
npm "scripts" are commands from the scripts section of the package.json.
31 replies
KPCKevin Powell - Community
Created by snxxwyy on 6/26/2024 in #resources
unicode character list
On Linux you type Ctrl+Shift+U & you'll get a u̲ prompt that lets you type in the hex you want. On Windows, supposedly, the Alt key plus the decimal representation of a character entered on the numeric keypad gets you a glyph. Wikipedia recommends BabelMap on Windows for exploring Unicode. I use Gnome Characters on Ubuntu. There's also simply the Unicode.org pdf charts.
28 replies
KPCKevin Powell - Community
Created by CDL on 6/25/2024 in #os-and-tools
How to work on a project on 2 local machines?
Something we do on a project I'm helping with is have a GitHub Action that builds a Docker container & deploys a Google Cloud Run instance for every pull request. (That sample code looks pretty complicated because it's building an Express instance which backs a Hasura instance which is used to server-side render a Next.js app.) It's really handy to sanity check pull requests by seeing the code that will be merged in action. Vercel will also build PR instances if you connect a GitHub repository.
23 replies
KPCKevin Powell - Community
Created by JJ on 6/25/2024 in #front-end
Need Help identifying different Semantic Sections
I've have the top bit be a <header> & the rest be a <main>.
2 replies
KPCKevin Powell - Community
Created by عبد الحي on 6/25/2024 in #front-end
array doesn't want to go away
In general, statement ? true : false is an antipattern since your ternary does nothing but complicate reading the logic.
22 replies
KPCKevin Powell - Community
Created by عبد الحي on 6/25/2024 in #front-end
array doesn't want to go away
const newMix = mix.filter((x) => (typeof(x) == "string") ? true : false)
I think you mean: const newMix = mix.filter((x) => typeof(x) === 'string') 😸
22 replies
KPCKevin Powell - Community
Created by salentipy on 6/20/2024 in #os-and-tools
Cygwin Question
If you've got the space for it, Windows Subsystem for Linux (WSL) is worlds better than Cygwin.
7 replies
KPCKevin Powell - Community
Created by Zax71 on 5/23/2024 in #back-end
Low quantity image storage
Next.js uses the sharp library for resizing in real time.
20 replies
KPCKevin Powell - Community
Created by MartynasXS on 5/14/2024 in #front-end
JSON history - string vs object
For speed and ease of access, I'd expect the parsed version to be more effective. For space efficiency, it depends on what sort of data you have. If you're storing lots numbers, the parsed version will be 8 bytes and the string version will be 1 byte per character. If you've got lots of strings, the storage will be about the same, but you'll be doing away with the pointers between objects. How big is "large"? Recall that small images are dozens of kibibytes. The space you save by serializing isn't going to be all that much though, and I wouldn't think it'd be worth it. The ideal would be some sort of representation of actions taken with the ability to reverse them. If you find a good diffing algorithm, post it. I've been contemplating a distributed graph database & would love a solid method for succinctly expressing differences in state.
11 replies
KPCKevin Powell - Community
Created by taj0023 on 5/9/2024 in #back-end
Where to declare a types file
Honestly, to answer your question, I would dig through MetaGame's Game repo which is the monorepo I have the most experience with. I'd look at the root package.json & tsconfig.json as well as those files in packages/backend/ & packages/web/ which are analogous to your server & client. I don't have time right now.
6 replies
KPCKevin Powell - Community
Created by Sanchari on 5/8/2024 in #os-and-tools
Error: Couldn't find an i386-*-elf version of GCC/binutils.
Generally apt is for managing Linux systems, & libc6-dev:i386 is a Debian package. Looking at the README, you'll need a cross compiler & the make commands are for building on a Linux system. Also, the last commit to the project was six years ago. If you're going to be cross compiling anyway, why not work from the RISC-V port? As for what your exact command should be to compile, I don't know Macs (or C) that well.
6 replies
KPCKevin Powell - Community
Created by taj0023 on 5/9/2024 in #back-end
Where to declare a types file
If you want to share code between projects, you might consider a monorepo that has a package.json (and tsconfig) in the root with a section like:
"workspaces": {
"packages": [
"client/*", "server/*"
]
},
"workspaces": {
"packages": [
"client/*", "server/*"
]
},
6 replies