#🪅-progaming
1 messages · Page 134 of 1
what react router do they use
everything is stateful, everything relies on some state from some useeffect or useatom thats defined globally in one file, then referenced in 40 other files, and passed tru 200 components, and the atom states update somewhere 9 components deep
its CRAZY
HUSK
like i cant even fucking load this shit because windows lags out
unreal
element devs banned from ever writing code again
true
fucking generic react project moment
and not only is the code unreadable element doesn't even work
so all that code is worthless
react also banned from existing
dont worry. element's is 1.4 gigs
nice
has anyone put bad apple on telnet yet
because if not than im going to
nvm its only a gig
almost certainly
Bad Apple!! Telnet Server. Contribute to stevenjoezhang/badapple-telnet development by creating an account on GitHub.
one whole gigabyte
my shit also has audio
using
ffplay on another window
if it can show images or play audio someone has played bad apple on it
this is written in C
mine is in rust
if it can show images or play audio [both optional]

actually
i made it able to use any.. yes ANY video as an input
looks like dogshit but
oh well
already built it for
aarch64-unknown-linux-musl
x86_64-unknown-linux-musl
x86_64-windows-something
wow
perfectly 1MB
sparc64-unknown-linux-gnu when
you know what
fuck it im doing it
does it even exist tho
holdon
why musl
arent rust musl builds incredibly unoptimized
runs on everything
more portable
not really
my shitty app does NOT need to be optimized
true
oh my god bro i do NOT want to do allat
do you all know that feeling when youre sick and it feels like your neck has herpes on the inside
the actual playback starts at 1:30
first 1:30 is just server starting and setup
o yeah i have no idea why the percentage of converting is like that
and
i don't really gaf anymore
i-want-to-kms-too-buddy
buddy
the problem at first was
the audio and video was not syncing
took me like 2 hours
and figured out the easiest way to fix that
which is don't provide the audio data to ffplay BEFORE the video starts
i know im dumb
wha
the big pause between reading and converting is... something
i don't know
we all use pascalCase right?
OfCourseWeDo
brother
openclaw
if i said yes, would you
_ _
what
yes
i would react
is that what you mean
https://github.com/facebook/react
it's react
no would you
_ _
nah i would not
_ _
are you sure you wont
_ _
nah i wont
_ _
i think you will
_ _
nah i won't
_ _
i will
_ _
you should
_ _
what if i krill myself
grill myself
ill turn into a rusteacean
guess
openclaw
my favourite programming language
haxe
rust
linux
no
vencord
no
any cursed syntax enjoyers know if something like this is possible in js?
class Test {
life = 42
nested = {
double: this.life * 2,
quad: this.nested.store * 2
}
}
Nope you can't do this, because I believe, inside an object this context is not the same, the object make its own context.
After testing a bit in the REPL you can do something like this :
class Test
{
life=42
nested = () => {
return {
double: this.life * 2,
quad: this.nested().double * 2
}
}
}
It works, if you omit this is recursive and throw a RangeError, nothing unsolvable.
Here it works because arrow functions does not have their own this context they borrow inherit it from their parents.
how would this ever work its a cyclic reference
yeah you can use an arrow function, i dont think its possible to make it an iife unfortunately
ok you know what
you can do this
class Test {
life = 42;
nested = {
get double() {
return this._owner.life * 2;
},
get quad() {
return this._owner.nested.double * 2;
},
_owner: null
};
constructor() {
this.nested._owner = this;
}
}
``` if you really want to have the interface of `test.nested.quad` or whatever
this is fucking horrible
you can also do this
class Test {
life = 42;
nested = new Proxy({}, {
get: (_, prop) => {
const store = Reflect.get(this, 'life', this) * 2;
if (prop === 'double') return store;
if (prop === 'quad') return store * 2;
}
});
}
console.log(new Test().nested.quad)
i only ever have the best ideas
wdym its so peak
ok you know what
you can simplify it to this
class Test {
life = 42;
nested = new Proxy({}, {
get: (_, prop) => {
if (prop === 'double') return this.life * 2;
if (prop === 'quad') return this.nested.double * 2;
}
});
}
``` and this actually is not that bad
the only reason this works is because the function that yields the value must be an arrow function, otherwise you could do it with getters instead but those act like full functions afaik with the this being within the object itself
and finally, so it looks more like an object:
class Test {
life = 42;
nested = new Proxy({}, {
get: (_, prop) => {
switch (prop) {
case 'double': return this.life * 2;
case 'quad': return this.nested.double * 2;
}
}
});
}
WAIT
ok finally
class Test {
life = 42;
nested = new Proxy({}, {
get: (_, p) =>
p === 'double' ? this.life * 2 :
p === 'quad' ? this.nested.double * 2 :
undefined
});
}
feels just like an object
rosie writing horrorcode
you could even do this
class Test {
life = 42;
nested = new Proxy({}, {
get: (_, p, r) =>
p === 'double' ? this.life * 2 :
p === 'quad' ? r.double * 2 :
undefined
});
}
@valid jetty im taking class on linear algebra
awesome
you learned this at 10 years old though so im just doing the basics
@supple whale i think this is my final version what do you think
hiiiii
so you cant, ok
wdym you can
@supple whale this is probably the sanest one realistically
but it's not programmatic
and the boilerplate is horrific
I wanted to do that for DXA
so I can organize a massive class and have collapsible properties in it
@rosie.pie eep
insane
https://lyra.horse/x86css/
sex trafficker btw
TIL here s is typed as string if noImplicitAny is true, otherwise it's implicitly any
let s;
if (true) {
s = "foo";
}
Broken clock syndrome
WE LOVE ENUMS
// this is likely overkill, but my brain is fried
// TLDR this needs to work with both TypedMatrixEvent<EventType.RoomPinnedEvents> and TypedMatrixEvent<'m.room.pinned_events'>, which is a bit of a nightmare to type
type EventTypeLike = EventType | `${EventType}`
type ResolveStateEventKey<T extends EventTypeLike | keyof StateEvents> = {
[K in keyof StateEvents]: T extends K ? K : T extends `${K & string}` ? K : never
}[keyof StateEvents]
type StateEventContent<T extends EventTypeLike | keyof StateEvents> = ResolveStateEventKey<T> extends never
? IContent
: (StateEvents[ResolveStateEventKey<T>] & IContent)
export interface TypedMatrixEvent<T extends EventTypeLike | keyof StateEvents = EventType> extends MatrixEvent {
getType: () => T
getContent: <Z extends IContent = StateEventContent<T>>() => Z
}
@jade stone
type EventHandlers = {
[K in Extract<keyof GlobalEventHandlers, `on${string}`>]: K extends
`on${infer E}` ? E : never;
}[Extract<keyof GlobalEventHandlers, `on${string}`>];
@ifs and css functions
huh but
thats not what i'm doing
im mapping an enum, or that enum as a string, to a property map
yes i just wanted to show my cursed typescript types
using bun --bun dev in my nextjs project causes HMR to be like 100x slower
cant figure out why
oh wait its bun

yop, typescript enums have no issues
@jade stone loves bun
@jade stone loves bun
husk
hello
i need help with something
i have a a question about a plugin
@jade stone
vns
so basically is there a plugin that always shows the username overlays while your in call yk the ones that when you hover over a discord call they show everyones name
im dumb ok hollup
ill see you on the flip side
tar.zst
TAR BAD
@jade stone make me a version of vencord that has calls and nothing else
ZIP
like the entire app is just voice channels and nothing else
XD
i'll put a $5 bounty on it
no, see, teamspeak doesnt work with people connected to discord channels
if u manage to make some webrtc proxy, where u can connect to discord channels from my own webrtc instance i'll suck like 2 dicks tho
and $50
XD
@supple whale downloading file over websocket instead of streaming it over http ❤️
WHY?!
LORD WHY
cba to setup http server 
BASE64 ENCODED AS WELL?!
BRO, WEBSOCKET IS A HTTP SERVER!!!!!!!!!!
AND WEBSOCKET SUPPORTS BINARY DATA
U DONT NEED TO SERIALIZE IT!!!!!!
satan doing it worst way possible
yop
YOU DONT EVEN STREAM IT TO A FILE
satan what if you made it to mp4 and streamed it using hsl
i should probably call this too @supple whale
i mean
please fucking do this.
no firefox
then
await writable.write(contents);
// Close the file and write the contents to disk.
await writable.close();
yes, when your user open firefox you autoredirect them to the chrome download page
same for safari
and on iOS you redirect do android.com
holy shit, 9 prompts later:
type ContentEvents = StateEvents & TimelineEvents & AccountDataEvents & RoomAccountDataEvents
type EventTypeLike = EventType | `${EventType}` | keyof ContentEvents
export interface TypedMatrixEvent<T extends EventTypeLike = EventTypeLike> extends MatrixEvent {
getType: () => T
getContent: <Z = ContentEvents[Extract<keyof ContentEvents, T | `${T & EventType}`>] & IContent>() => Z
}
AI actually goated for this kind of "simplify my TS types" shit
that said i went tru 20% of my monthly quota for copilot XD
the fact that TS doesnt have
if (event.type === 'custom'): event is CustomEvent {
}
guards is crazy doe
and u need an util function in there, which is disgusting
it does if event is a discriminated union
well
yes but no
because if i do type === then sure
but getType() === then no
:))))
well yeah
WELL WHY
typescript can't know functions are pure
how can i fix that D:
try a getter
well its not my method
oh
i'm overriding a library's types
idk then 
which were attrocious and non-functional
@solemn ravine @woven mesa @pearl parrot Unserious company
https://blog.cloudflare.com/vinext/
Who is reviewing this code? Mostly nobody. This is an experiment in seeing how far AI-driven development can go. The test suite is the primary quality gate — not human code review. Contributions and code review are welcome.
peak
how
love?
NOP
husk
java doesn't have string boxing afaik
i think kotlin has its own string though which it implicitly converts the java string to
oh yea
forgot strings aren't primitives in java
just literals
@deep mulch
eh not really comparable
js primitive classes are mostly useless
T-T
https://1475870851885699147.discordsays.com/
i dont know what the fuck i did but it worked
wann anklage
@jade stone HOLY
FIREFOX FINALLY SCORED A W
https://cdn.discordapp.com/attachments/1077038104755589151/1476019442059182271/Screenshot_20260225_015113.jpg?ex=699f99ba&is=699e483a&hm=377a8d0da4f651d1d21cd963bdede2e5e07f3e7fec2cc87defd42619a824c480&
https://cdn.discordapp.com/attachments/1077038104755589151/1476019442373623840/Screenshot_20260225_015135.jpg?ex=699f99ba&is=699e483a&hm=824debcfb0dc4e7e40139059e5528378711ae8816306a956c5be4d4b9d733428&
it supports system accent color
aka material you
and chrome doesnt
Kotlin string is just a typealias iirc
Zooter will contribute to my Kotlin game engine 
Does it use OpenGL?
It does
smh
what if i made a game engine in js smh
I am pretty sure of this because i was trying to get some kotlin code to run without the runtime libraries it expects

I mean yeah it does define some extensions
not hard
there's plenty of appeal for it
problem is, your 2 options are opengl ES3.0
or webgpu which is a 2015 version of vulkan
with little browser and device support
That's really cool
I had it at some point in chromium
I didn't realise they removed it again
Oh wait no that's for themeing user agent styled elements like inputs with your accent colour, i think it still has that
at least on android with material you it probably is a very unique value
since there are so many colours and it'll be different for each user if they use wallpaper colours
you could probably limit that by having just some 32 colours and choose the closest one for websites
why is it the case that getting the cache on discord is as easy as getting the c property on the require function
I stole this trick from webpackgrabber but vencord doesn't seem to use it https://github.com/Vendicated/WebpackGrabber/blob/main/WebpackGrabber.user.js#L15-L33
WebpackGrabber.user.js: Lines 15-33
function extractPrivateCache(wreq) {
let cache = null;
const sym = Symbol("wpgrabber.extract");
Object.defineProperty(Object.prototype, sym, {
get() {
cache = this;
return { exports: {} };
},
set() { },
configurable: true,
})
wreq(sym);
delete Object.prototype[sym];
if (cache) delete cache[sym];
return cache;
}
no, it's a color value
that can simply be applied to anything
patch-package? i've always just used pnpm patch <package-name>
also i love pnpm for having a patching system
best thing ever
Ya I was just messing around
well it's not perfect
it's pretty damn good imo
it has name collisions if you install via GitHub or alias a packagename
@jade stone do https://codingchallenges.fyi/challenges/challenge-forth/
maybe
seems intresting
I would guess that if your code makes use of require.cache then it will add webpackRequire.c
ohh that makes sense
ye they do
if (webpackId in require.cache) {
console.log(...);
throw err;
}
i wonder what webpack does if you do like
require["CACHE".toLowerCase()]
maybe if the value is unknown it just assumes anything could be accessed
wouldn't it be better to use the prototype pollution trick in case discord stops doing this

ModuleConcatenationPlugin seems like a pita for modding
simply make a version of findByCode which searches every single function every declared even if not exported
wait what if there was a function which registered the search string and then returned a proxy which later forwards to the function once it's found by parsing the javascript of each module that is loaded, finding function syntax nodes and if their body contains the string surrounding them with an assignment
genius
yop
thank god discord has it disabled
ah so that's why it's not common you need a patch just to access a function
you mean using a patch to get access to a non-exported function
yeah
yeah, i only know of once place off the top of my head were we do that
because there are no exported functions which webpack made unexported with module concatenation
imagine if discord enabled this
easy way to end client mods? though I guess it doesn't make anything impossible maybe just really annoying 
(it would probably be a headache to debug in prod)
no breakpoints 
- idk how source maps would work with that
fluxer has source maps and uses file paths for module ids in prod
oh as well as module concatenation
the source maps do work
how do they work with breakpoints
uh
i can't get chromium to show the mapped sources
it was working in firefox
or wait no ..
I think I only saw it work in chromium
guh
oh they're under fluxer_app I am stupid
how do breakpoints work? they just do lol
why would it....?
it would break going the other way around
an object with a readonly bar is a subset of the object of the mutable bar
im pretty sure if you tried to do myReadOnlyFoo = myFoo it would throw an error
i think i'm just confusing myself more 
because assigning myReadonlyFoo to myFoo means bar goes from being readonly to mutable on the same instance
to really spell it out:
Man, this fake mute and deafen is making me rage atp. I'm trying to make it have a reasonable place where to be but I still can't find any that's valid.
a fake mute and deafen plugin sounds really creepy
also it doesn't just necessarily bypass intentional protection it could lead to something only being stopped at runtime instead of compile time which isn't great
I think this illustrates it well because a mistake you might make is passing a readonly thing to a function that expects to be able to mutate it
also when you do it with arrays suddenly the situation is different
TS is weird
creep
@deep mulch @pearl parrot more great code
function computeRectClipOffsets(
el: DOMRectReadOnly,
bounds: DOMRectReadOnly,
avoid: Pick<DOMRectReadOnly, "top" | "bottom" | "left" | "right">,
): [RectOffset, mapper: Record<TooltipPosition, TooltipPosition>] {
let mapper: Record<TooltipPosition, TooltipPosition> = MAPPER_NOOP;
if (rectFullyContainedBy(el, bounds)) {
return [NO_OFFSET, mapper];
}
let top = 0;
if (rectHeightCanBeContainedBy(el, bounds)) {
// too far up
if (el.top < bounds.top) {
if (avoid.bottom > bounds.top) {
mapper = MAPPER_FLIP;
}
top = Math.max(bounds.top, avoid.bottom) - el.top;
// too far down
} else if (el.bottom > bounds.bottom) {
if (avoid.top < bounds.bottom) {
mapper = MAPPER_FLIP;
}
top = Math.min(bounds.bottom, avoid.top) - el.bottom;
}
}
let left = 0;
if (rectWidthCanBeContainedBy(el, bounds)) {
// too far left
if (el.left < bounds.left) {
if (avoid.right > bounds.left) {
mapper = MAPPER_FLIP;
}
left = Math.max(bounds.left, avoid.right) - el.left;
// too far right
} else if (el.right > bounds.right) {
if (avoid.left < bounds.right) {
mapper = MAPPER_FLIP;
}
left = Math.min(bounds.right, avoid.left) - el.right;
}
}
return [
{
top,
left,
},
mapper,
];
}
vdumbai what does that do
The function computeRectClipOffsets calculates the offsets for a rectangle clip based on a given el and bounds. It checks if the el is fully contained within the bounds, and if so, returns a mapping that flips the top and left offsets. Otherwise, it checks if the el is fully contained within the bounds, and if so, flips the top and bottom offsets. If the el is not fully contained, it checks if the el is fully contained within the bounds, and if so, flips the left and right offsets.
-# Response generated by gemma-3-1b-it. AI may be incorrect or misleading.
vdumbai explain what you mean by el
el represents a rectangle's position. It’s a coordinate value.
-# Response generated by gemma-3-1b-it. AI may be incorrect or misleading.
oooh
Vee so blind
vdumbai true?
Yes.
-# Response generated by gemma-3-1b-it. AI may be incorrect or misleading.
Also this is just wrong
me when the dumb ai is dumb 
husk
jumpscare
🔥 Features
Whats with that magic string
Insane
SEX!
<script lang='ts'>
import type { ImageContent } from 'matrix-js-sdk/lib/types'
import { mxcToHttp } from '$lib/modules/matrix/event'
export let content: ImageContent & { info?: { ['xyz.amorgan.blurhash']?: string } }
$: name = content.filename ?? content.body
$: src = mxcToHttp(content.url ?? content.file!.url, content.file)
$: size = content.info?.size ?? 0
$: width = content.info?.w ?? 0
$: height = content.info?.h ?? 0
// $: blurhash = content.info?.['xyz.amorgan.blurhash']
</script>
({width}x{height}, {Math.round(size / 1024)}KB)
<img {src} alt={name} class='h-full' />
and
export function mxcToHttp (mxc: string, encrypted?: EncryptedFile) {
const url = getHttpUriForMxc(
get(wellknown)!['m.homeserver']!.base_url!,
mxc,
undefined,
undefined,
undefined,
true,
true,
true
)
if (!encrypted || !url) return url || mxc
// Encode encrypted file metadata in search params
const urlObj = new URL(url)
for (const [key, value] of Object.entries(encrypted)) {
urlObj.searchParams.set(key, JSON.stringify(value))
}
return urlObj.toString()
}
so i have a component for rendering a file
simple enough right
but the file is ENCRYPTED TO SHIT
which is why i pass the encryptedfile object as search params
encryptedfile:
then in a service worker i do:
function isMatrixMediaRequest ({ origin, pathname }: URL): boolean {
if (origin !== baseUrl?.origin) return false
return pathname.startsWith('/_matrix/client/v1/media/') || pathname.startsWith('/_matrix/media/v3/')
}
const DESTINATIONS = new Set(['image', 'video', 'audio'])
registerRoute(
({ url, request }) => {
if (!DESTINATIONS.has(request.destination) || !accessToken || !baseUrl) return false
return isMatrixMediaRequest(url)
},
async ({ url, request }) => {
if (!accessToken) return await fetch(request)
const headers = new Headers(request.headers)
headers.set('Authorization', `Bearer ${accessToken}`)
const hasParams = url.search.length > 1
const encryptedParam = Object.fromEntries(url.searchParams.entries().map(([key, value]) => [key, JSON.parse(value)])) as EncryptedFile
for (const param of url.searchParams.keys()) url.searchParams.delete(param)
url.searchParams.set('allow_redirect', 'true')
const res = await fetch(url, {
...request,
headers,
cache: 'default'
})
if (!hasParams) return res
return new Response(await decryptAttachment(await res.arrayBuffer(), encryptedParam), res
)
}
)
so file is decrypted before it ever reaches the app itself

and now that i have it as a "response" in a service worker i can do service worker things with it like caching etc
decryptattachment is fun:
generic web crypto shit XD
Insanity
i love how many cool web APIs came together for this
and how fucking clean it is
and how powerful
0 load in the UI, AND i can cache this shit, AND its super smart

All I did today is improve my tooltip component
i havent coded all day
Before
went out
After
ate to much fucking sushi its nuts
neat
i wish you simply used the popover API for this
would have handled that for u lmao
I use that for my modal api
Also use it for my popout component lol
holy fuck ```html
<script lang='ts'>
is the most illegal thing ive ever seen
single quote string for an html attribute 
(yes it's svelte but still)
How would popover API help
i have double quotes banned in all my code
TS, CSS, HTML
EVERYWHERE
how do u use rust and still like single quote strings
single quote is for chars
i dont use rust!
i used it for 1 single paper, for which i wrote 30 LOC
lies
yeah honestly
idfk what github is cooking there
because i dont have any rust repos
honestly turbo confused about that too
400kb of generated rust
fuck me i imported 1 lib and it has more code than all my js combined?
fuck me....
fuck native!
u pushed the build folder lmao
i wonder if it's counting anything in here
yeah cuz its wasm
there made that priv
hopefully it wont count when it updates next week
@supple whale actually wondering about this
isnt there like a "root" or "relative" thingy for those now?
I could use anchor positioning but iirc doesn't play well with the arrow
I had a version of it just built on anchor positioning
I got rid of it because Firefox didn't support anchor positioning
Might bring it back
do it then teach me
i want to learn anchor positioning to decide if its better than floating-ui libs
Soon
I use popover api and to my knowledge no
I fixed it with js
as in popover API is bad?
vs libs?
or libs are bad?
No, it's good
wha?
Stuff like https://floating-ui.com/docs/
const POPOVER_VIEWPORT_PADDING = 8;
export function Popover(props: PropsWithChildren<{ renderPopover: () => React.ReactNode; focusRing?: boolean }>) {
const { renderPopover: PopoverContent, focusRing = false, children } = props;
const id = useId();
const [shouldRender, setShouldRender] = useState(false);
const [open, setOpen] = useState(false);
const popoverRef = useRef<HTMLDivElement>(null);
const onToggle: ToggleEventHandler = e => {
setOpen(e.newState === "open");
if (e.newState === "closed") setShouldRender(false);
};
const onBeforeToggle = () => {
setShouldRender(true);
if (popoverRef.current) popoverRef.current.style.opacity = "0";
};
useLayoutEffect(() => {
if (!open) return;
const el = popoverRef.current;
if (!el) return;
el.style.translate = "";
const rect = el.getBoundingClientRect();
let translateX = 0;
let translateY = 0;
if (rect.right > window.innerWidth - POPOVER_VIEWPORT_PADDING) {
translateX = window.innerWidth - rect.right - POPOVER_VIEWPORT_PADDING;
}
if (rect.left < POPOVER_VIEWPORT_PADDING) {
translateX = POPOVER_VIEWPORT_PADDING - rect.left;
}
if (rect.bottom > window.innerHeight - POPOVER_VIEWPORT_PADDING) {
translateY = window.innerHeight - rect.bottom - POPOVER_VIEWPORT_PADDING;
}
if (rect.top < POPOVER_VIEWPORT_PADDING) {
translateY = POPOVER_VIEWPORT_PADDING - rect.top;
}
el.style.translate = `${translateX}px ${translateY}px`;
el.style.opacity = "1";
}, [open]);
return (
<>
<Clickable popoverTarget={id} className={classNames(focusRing && "focusRing")}>
{children}
</Clickable>
<div
popover="auto"
id={id}
ref={popoverRef}
className={styles.popover}
onToggle={onToggle}
onBeforeToggle={onBeforeToggle}
>
{shouldRender && <PopoverContent />}
</div>
</>
);
}
this is what I used for positioning popovers 
and css
.popover {
position-area: bottom;
position-try-fallbacks: top;
margin: initial;
padding: 1em;
border-radius: 8px;
background: var(--bg2);
border: 1px solid var(--shadow);
box-shadow: 0 4px 12px var(--shadow);
&:popover-open {
display: block;
}
}
that useLayoutEffect is vibe coded cause I couldn't be arsed but it works well
Hop on anchor positioning
main bugs are due to CSP but it works
I do
but they still go off screen
idt there's a way to fix that without js
There is
I'll send when I get home
black is the page
red is the popover parent
green is the popover
that hook makes it like this instead
but still properly centred if possible
left: clamp(
calc(var(--padding-left, -100vi + 100%)),
var(--left),
var(--padding-right, 0px)
)
thank you for coming to my ted talk
--left would be your actual position
but idk how that computes with popover api
@royal nymph this is what i made when i made tooltip with css anchors
not sure if you can use a custom element instead of the viewport
if you don't want the animations you can do this with 0 js i think
@jade stone did i ever mention how much i fucking LOVE WORKBOX?!?!?!
registerRoute(
({ url, request }) => {
if (!DESTINATIONS.has(request.destination)) return false
return PATHNAMES.some(path => url.pathname.startsWith(path))
},
new CacheFirst({
cacheName,
plugins: [
{
async requestWillFetch ({ request }) {
const awaited = await session
if (!awaited) return request
const url = new URL(request.url)
const headers = new Headers(request.headers)
headers.set('Authorization', `Bearer ${awaited.accessToken}`)
const hasParams = url.search.length > 1
const encryptedParam = Object.fromEntries(url.searchParams.entries().map(([key, value]) => [key, JSON.parse(value)])) as EncryptedFile
// Strip encrypted params from URL before sending to server
for (const param of url.searchParams.keys()) url.searchParams.delete(param)
url.searchParams.set('allow_redirect', 'true')
if (hasParams) encryptedParamsCache.set(url.toString(), encryptedParam)
return new Request(url, { ...request, headers })
},
async fetchDidSucceed ({ response, request }) {
const encryptedParam = encryptedParamsCache.get(request.url)
encryptedParamsCache.delete(request.url)
if (!encryptedParam) return response
// needs spread operator, otherwise things break
return new Response(await decryptAttachment(await response.arrayBuffer(), encryptedParam), { ...response })
}
},
new RangeRequestsPlugin(),
new CacheableResponsePlugin({ statuses: [0, 200] }),
new ExpirationPlugin({ maxEntries: 20, maxAgeSeconds: 7 * 24 * 60 * 60 })
]
})
)
I MEAN HOLY FUCK IMAGINE TRYING TO DO THIS YOURSELF
just fucking
new RangeRequestsPlugin(),
new CacheableResponsePlugin({ statuses: [0, 200] }),
new ExpirationPlugin({ maxEntries: 20, maxAgeSeconds: 7 * 24 * 60 * 60 })
'ed that bitch
JESUS IT FUCKS
insane
@calm ruin who needs fancy css to prevent word breaking when you can just use NBSP
ui libraries for tooltips it is!!!!!!
Yeah, that's the answer I came too as well, but I like how css can still get 90% of the way there
welp
all message types implemented!
@supple whale TIL the android back button/gesture will attempt to pop the top popover off the stack before attempting to navigate
@deep mulch I love android back gesture
nixos moment
How
idk
https://fixupx.com/sarah1312uwu/status/2026743553833967764?s=20 vibecoding is so hard
matrix spec: so for attachment encryption, lets support a streamable, seekable encryption algortihm, that way there's no upper limit of the attachment size!
EVERY SINGLE MATRIX CLIENT: src = URL.createObjectURL(fetch().blob())
god why are web devs so inept
okay guys i have pro tip for yall
never make yourself write your final work at school in nextjs
sir remember
always go the path of least resistance and less effort
more effort is never rewarded in work or school
look, in september i had a different idea about next
i did the ABSOLUTE BARE FUCK MINIMUM in uni, and got a 100% on my thesis, and a 96% grade average
and thats doing as fucking little as possible, attending as little classes, and putting as little effort into the paper as possible
the code for my paper was like 40 LOC in total
the excell spreadsheets were more work than the code!
use wasm_bindgen::prelude::*;
use sha2::{Sha256, Digest};
#[wasm_bindgen]
pub fn sha2(data: &[u8]) -> Vec<u8> {
let mut hasher = Sha256::new();
hasher.update(data);
hasher.finalize().to_vec()
}
use wasm_bindgen::prelude::*;
use flate2::{Compression, write::GzEncoder, read::GzDecoder};
use std::io::prelude::*;
#[wasm_bindgen]
pub fn gzip_compress(data: &[u8]) -> Vec<u8> {
let mut encoder = GzEncoder::new(Vec::new(), Compression::default());
encoder.write_all(data).unwrap();
encoder.finish().unwrap()
}
#[wasm_bindgen]
pub fn gzip_decompress(data: &[u8]) -> Vec<u8> {
let mut decoder = GzDecoder::new(data);
let mut result = Vec::new();
decoder.read_to_end(&mut result).unwrap();
result
}
wasmBench.add(`${size}`, () => {
return wasmGzip.gzip_compress(data)
})
compressionStreamBench.add(`${size}`, async () => {
const { writable, readable } = new CompressionStream('gzip')
const writer = writable.getWriter()
writer.write(data)
writer.close()
return await new Response(readable).arrayBuffer()
})
pakoBench.add(`${size}`, () => {
return pako.gzip(data)
})
thats all the code from my master's thesis
XD
oh wow
i probably spent more time thinking about what to write about so that its as little effort as possible
than i actually did writing the code
writing the paper was ass tho, so much uni speak
yea atp i spent more time deploying the project than working on it
there are better frameworks 🙏
SVELTE
how the fuck
well the teachers make us hardcode the technologies into the assignment of the thesis...
so im forced to use next
thats not a framework
yes
svelte is also a framework
your definition of framework is ass, because you think about it as a UI framework + router
clearly.
ive given up on this so im just hardcoding the variables into the build files
im just so tired about this
and i'm implementing AES-CTR decryption in web streams
shouldve chosen tanstack start...
so i can do
return new Response(response.body?.pipeThrough(createDecryptionStream(encryptedParam, 0)) ?? response.body, {
status: response.status,
statusText: response.statusText,
headers: responseHeaders
})
im never making this mistake again
which one there's like a dozen so far
what defines a framework
A software framework is software that provides reusable, generic functionality which developers can extend or customize to create complete solutions.
vai whats framework
A framework is a pre-defined, reusable software structure that provides a foundation for building applications. It typically includes libraries, tools, and guidelines to streamline development by offering common functionalities and patterns.
-# Response generated by gemini-2.5-flash. AI may be incorrect or misleading.

vai difference between library and framwork
The key difference between a library and a framework lies in who controls the flow of execution, often referred to as "Inversion of Control" (IoC).
- Library: You, the developer, are in control. You decide when and where to call specific functions or classes from the library to perform specific tasks. Libraries are typically designed for a focused scope, like handling dates or making HTTP requests.
- Framework: The framework dictates the overall structure and flow of your application. You write your code to fill in the gaps or conform to the framework's conventions, and the framework then calls your code when needed. Frameworks provide a comprehensive foundation for building entire applications.
In essence, your code calls a library, but a framework calls your code.
-# Response generated by gemini-2.5-flash. AI may be incorrect or misleading.
!!!
WHY DOES THE NORMAL BUILD WORK BUT DOCKER FAILS

BRO WHAT
mewhenthe vibecoded js runtime is actually shit
who could have seen this coming
well clearly not you
i just bun specific shit
there's nothing wrong with using it per se; however, there are a plethora of issues that make it terrible.
you love shithub just not showing line numbers randomly
what dpes those even do 
keys have to match it
in this case, start with react-hooks/
you can do things like ${"foo" | "bar"}${"1" | "2"} which is the same as "foo1" | "foo2" | "bar1" | "bar2"
sixseven
sixseven
sixseven
are u sure those arent part of line 300 with text wrapping enabled

for context, nodejs is ~50ms, luajit is ~34-40ms
being only 14ms slower than nodejs, and by extension v8 is a pretty huge win imo
are you aot, jit or interpreted
jit
I have an interpreted mode but it takes about 2 seconds for bytecode and 6 for raw ast lmao
send repo
i just jit my pants
i haven't pushed to git yet
im leaving on a trip today so i can't until sunday
well i have the base language stuff on github, but no bytecode/jit stuff
@sour wing can you bench your lang without jit against node --jitless
i can't get on my pc right now 😭
I did compare against python without jit though, and they took about 660ms
with jit it took a bit longer, but pypy with an actually good jit took 80 something ms
what are you using as a backend for the jit 
asmjit
also TIL PCRE2 JITs regex
oh yeah my language doesn't have regex support yet
i need that
depending on yet another dependency is kinda sad, but my ass is not writing a regex interpreter
yes and the rest of the ~9k line file also doesn't have them
also it happens at semi random and gets fixed by refreshing (sometimes)
very cool
the fuck is that
thing
yes
yes its good
yes
THIS IS THE MOST BEAUTIFUL WAY TO FREE EVERYTHING
meow
What is this chat even abt lol
btw what theme r u using?
pro gaming
Seems like coding to me :^)
woah
@pseudo sierra bwa
@deep mulch bwa
TIL discord uses floating-ui
i would consider my monitor pretty flat
imagine if printf had nodiscard
Printf isn't void?
says average professional c developer, probably
returns the number of printed character or < 0 if it failed which is more common than one would think
I'm a professional c++ dev though, I don't use printf
youre gonna
fuck it
im making another javascript framework
why husk
the framework will make use of many web bun standards
I immediately switched away from bun after anthropic
i didnt ¯_(ツ)_/¯
tbh i wouldn't want to rely on bun specific apis
oh i wont that was a joke
ill use standard fetch handlers
why would i do that
that sounds incredibly sinful
this framework is gonna be like god intended
it returns int
im pretty sure the number returned is the number of characters successfully written to stdout
meanwhile cout << just returns the same object and you need to call othr functions to check errors 😭
cout feels like a bit of a backwards design compared to c's IO stuff in many ways
why do you think they added the print module to the stdlib
(and that just copies rust too lol)
what did people even do to get around formatting side effects in older c++ though...
wdym
i tried writing a raii wrapper for std::hex but it was ugly
if you do something like this std::cout << std::hex << 10; all future prints of numbers will be in hex - you need to remember std::dec
thats how you print hex using that??? that's awful
yeah
I feel the temptation to create my own standard library but it wouldn't be very standard then...
😭
do you not think people have tried
many times
somehow i find it hard to find things that replace the c++ stdlib instead of augment it
there probably hasn't been a big project doing that because it'd be bad for interop
don't those augment it instead of replacing it
you mean abseil right? asl doesn't seem to be a popular thing
literally says
Abseil is an open-source collection of C++ code (compliant to C++17) designed to augment the C++ standard library.
eastl also doesn't reimplement iostream stuff
I'm thinking, what if you could avoid linking to the c++ standard library at all (maybe just the c library stuff to make implementing an alternative standard library easier)
something i find annoying about c is you usually end up writing your own dynamic array/hash table for half the projects you do and that also happens with c++ if you avoid the standard library
templates are a pretty killer feature though at least you're unlikely to end up implementing a hash table multiple times in the same project 
my javascript runtime is solidphobic 😔
i am trying to use solid but it just decides to use react 😔
😔
first-world high-level problem
guess ill have to use react then 
adobe standard library
ah this is what came up
that heavily depends on the C++ standard library too though..
Does to string not have a radix arg
@valid jetty hiiii
hiiiii
I guess if the std::string implementation has a small string optimisation using tostring should be fine
iirc both gcc and clang do that
@jade stone any recommendations for code preview
for stuff like
const x = 'test'
in my own markdown editor?
Shiki
yeah no i need rendering
i have a string code and i need output html
thats syntax highlighted
read-only, not editable
Shiki can do that
ok thx
Or it can output to hast
ic its just shiki
No
god any configs like "heres a config for all langs" and shit?
Yeah, I forget off the top of my head tho
Here's how I use it
src/components/Codeblock/Codeblock.tsx: Lines 71-81
const highlightToHtml = useCallback(() => {
assert(shiki.highlighter, "Highlighter not loaded");
return highlightCode({
lang,
theme,
highlighter: shiki.highlighter,
code: children,
showLineNumbers: lineNumbers,
startingLineNumber: startingLineNumber ?? 1,
});
}, [children, lang, lineNumbers, startingLineNumber, theme]);
@jade stone
where are the leaks
i have them actually but can't send bc tos ykyk
you should be able to find them easily
i found it in a few minutes
Does anyone know how to access the list of favorited channels from the experiment dev://experiment/2026-01-favorites-server
discord is enshitifying it to only be available to nitro, and now i can't see which channels i had favorited
LOVE
(i did find a screenshot i took, so it's not that important anymore, but would still be curious if anyone does know)
i can send if you still need them
yes please
send to me @jade stone
can you like 7z it and put it on mega/mediafire/catbox/gdrive/...
oh is that the bigger leak
no no, the 7z is 6gb
there's a bigger leak?
i think so
i downloaded a ps3 one and the bigger one
this is both
yeah it has more targets
try pixeldrain
no limit on storage, 10gb max file size
yes
express running on chakra is the slowest js http solution
💔
nice you're a geometry dash player
ts pmo
@jade stone hop over to matrix fr fr
nah, hop on stoat instead
stoat is shitting itself under the load of 1000 new users
i doubt it has much life in it left
Would it be possible to have either a plugin or feature for vencord that basically joins steam into it? like allows you to launch games and/or show your library from steam into discord?
isn't this really easy
window.open("steam://rungameid/730")
yeah look it works
pointless though
that isnt tailwind wtf XD
pretty sure it's tailwind inspired

zed talks about it on their blog
this is just generic atomic css classes
in some sort of functional cursed lang
tailwind isnt that
tailwind is about generating classes/css based on your code
and providing the intellisense and utilities for generating them
anyway probably an observation I've made before but the average rust gui lib that people might call "native" actually feels less native than electron
I think different people mean different things because there's both native in the sense of native unsandboxed code and native as in actually fitting into the platform
when people say native, they often mean "doesnt have that feeling of generic web UI"
and sometines "includes platform provided components with their animations and stylings"
😭
like androids materialUI/materialYOU, buttons with their transitions and animations
tho for the most part, these things can be done with 10 lines of css
i wanted to write a paper on "what makes UI feel like webUI"
and it mostly boils down to the few lines of default CSS browsers provide, and how click actions and events are done and handled
because the only native thing about them is the language
I'd say that
img,a {
-webkit-user-drag: none;
}
*:focus-visible {
outline: none;
border-image: fill 0 linear-gradient(#8885, #8885);
}
*::-webkit-scrollbar {
display: none;
}
a[href],button,fieldset,input,optgroup,option,select,textarea,details,[tabindex],[contenteditable] {
&:active:not([disabled], [type='range'], .no-scale, [tabindex="-1"]) {
transition: all 0.1s ease-in-out;
transform: scale(0.98);
}
}
.scale-parent:has(.no-scale:active) {
transition: all 0.1s ease-in-out;
transform: scale(0.98);
}
is enough to make most web UI's not feel like web UI's, well at least 30% of the way there
yeah i guess
then add some 10 LOC for a view transition, and people will be hard pressed for telling that something is a webui lol
using rust for a project because it seemed to have promising gui options but idk there's probably more quantity than quality rn
unironically
just make a "chrome only framework"

like after all the bullshit i put up with
i arrived at "yup, just make it all chrome/electron only"
I'm not really interested in making electron stuff
but I can understand why people are
simply nothing comes even remotely close
oh no, its not that i love electron
its good, sure
its just everything else is dogshit
we should embed chrome in webassembly to fix browser incompitability
like NOTHING else comes close to chromium's performance, and HTML/css's ease of use for making UI
sike, firefox has issues with WASM
:))))
firefox never stop loosing
rewrite chrome in js to fix browser incomoitability?
ff's JS GC wont be able to keep up
https://github.com/ThaUnknown/jassub/blob/main/src/worker/util.ts#L53
https://github.com/ThaUnknown/jassub/blob/main/src/worker/util.ts#L45
https://github.com/ThaUnknown/jassub/blob/main/src/jassub.ts#L154
- no multithreading
- no growable memory references
- no shared memory references [not an issue since you cant do multithreading anyways LOL]
- random SIMD failures
we love firefox!
i use firefox and its okay
not even ai slop made me switch away from firefox
yeah because u dont write code for it
developers simply neuter their software to make sure it runs on ff
so TLDR you get worse or slower software, on all browers, just because ff exists
i use firefox basically because I like the ui better
rewrite firefox as chromium fork
i dont care about UI enough
i care about my browser not imploding, and being able to replace my native apps with modern APIs
WebHID for device driver updates my beloved

fuck having to install razer synapse
i just found out my god has claude code aliased to cc
This is what I came to lol
No good UI options in rust
the dx is pretty nice with some of them though
which ones 
i just want something like https://files.community/ but written in rust
gpui with gpui-component
because after using czkawka, the rust file system managment is so fucking fast its nuts
but the UI is so ass
Ah I never got to try out gpui
and files looks so nice, but is so ass
I used rust because I would use go but ui in go is probably worse
Tauri has experimental cef support so I think I will try that out next
r/ihadastroke
except using qt from go might be better
the qt rust wrapper i found needed unsafe everywhere 😭
I mean you should be able to have good ux with gpui
I've heard accessibility is nonexistent
i want to build my own UI framework for android using TWA's
which would make it 1:1 electron-like at that point
since i wouldnt need to use webviews with TWAs
but google's own examples for TWAs dont work
a glaring issue with gpui for me is the extremely blurry text but for some reason it's fine in my app
ah, sub-pixel rendering
i love drinking tea and progaming
not everything is about subpixel rendering, sometimes the pixels seem to just not be aligned right
this is a mega common issue for font rasterizers
ah it seems to be especially bad in pandora launcher which uses a particular font
because right after rendering the text a guassian blur filter is applied?
no, because of pixel interpolation
its fucking ass
buy a QDOLED, then spend 2 months researching why fonts look shit on it
and you'll learn
lol this is zed's hamburger menu
harfbuzz is pretty much the go-to for font rasterizers, but its infexibility in custom subpixel layouts is annoying
subpixel layout?
yesn't
"every poopoo time is a peepee time but not every peepee time is a poopoo time" - sun tzu
they are thanking their own fucking bot in blog 
pretty sure this is normal now though
hmm okay
:bunslop:
claude code wouldnt be this bad if it used blessed instead of ink
Xdddd
this is why you don't let your users set the font
i dönt see the issüe
i dönt see the issüe
@frosty obsidian dings
actually the font is called D050000L
@frosty obsidian wings
dear #🪅-progaming how do i make context menus in heaps2d
I wanna like rust but spending hours trying to get a small amount of code to compile feels like it takes the fun of programming out for me and makes me feel demotivated :(
when I do get something to work it feels great but I feel like I am still yet to be remotely productive
today I saw 84 compiler diagnostics on the same line (hint: async was involved)
If you can find the RAM for it rust-analyzer was genuinely a lifesaver for me
for me its just the size of the debug packages that get built bro 😭
300 megs for a simple project
Yeah, same here
hmm maybe if gpui has its own thread pool i don't need tokio
hmm but that might be wasteful
tokio can make more efficient use of threads right? so it doesn't need a whole thread per ongoing request? 😭
seems aio and select can be used
nvm aio isn't that popular
how to read from multiple named pipes at the same time in python
i guess spawning an Process for every fifo is not a good idea
I'm using rust analyser but I run cargo build for better error output
with rust analyser there were like 80 errors on the same line
bacon-ls is super good for diagnostics
it's way faster and usually gives diagnostics like cargo build does
cargo build also vomits out a lot of output in these cases though
i close the terminal and reopen it just for a clean slate
the problem is functions like tokio::task::spawn and methods like this background_spawn one require the future/closure to have a static lifetime which means they can't capture anything that isn't guaranteed to be valid for all eternity
I guess that's valid since the thread could outlive any of the references you are trying to use
it seems most people put Arcs on things but surely there's a better way...
I mean why use rust just to use a mini gc anyway
why not move the owned data in and get the results back from a channel or something like that?
I am spawing a task from the UI thread which I can't just await/select on a channel on
then you should probably use cx.spawn instead of cx.background_spawn to tie it to the lifetime of the ViewContext instead.. IF the task is local
pretty sure spawn is for sending a task back to the UI thread
wait lemme check again
if i do this in the main function
println!("main {}", std::thread::current().name().unwrap_or_else(|| "unnamed"));
cx.spawn(async |_| {
println!("spawned {}", std::thread::current().name().unwrap_or_else(|| "unnamed"));
}).detach();
it prints
main main
spawned main
background_spawn on the other hand I have observed to execute on threads named worker-...
but that task doesn't actually .await anything, with rust's async the task starts on the current thread and only moves (or lets the thread do whatever else) when it actually hits an await point.
i think the reason you see worker-... is because background_spawn is explicitly pushed to the thread pool immediately.
in cx.spawn i think if the executer sees the task is tiny and doesn't .await it just runs on the main thread
this is how I saw the thread name btw 
thread 'Worker-0' (21855) panicked at /home/me/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-util-0.1.20/src/client/legacy/connect/dns.rs:119:24:
there is no reactor running, must be called from the context of a Tokio 1.x runtime
it says in the docs though...
/// Spawns the future returned by the given function on the main thread. The closure will be invoked
/// with [AsyncApp], which allows the application state to be accessed across await points.
are you using a library like reqwest here?
idk.. rust async is very new to me
yeah
ohh wait I guess the tokio runtime would move it to another thread


I just copied that from wikipedia