justaweirdvivi

just 4 raccoons in a trenchcoat.

  • it/fae/she(/they)

(currently preferring it/its pronouns)
https://justaweirdvivi.neocities.org.


your local plural gay ace nb transfem genderfluid raccoon. (θΔ)
18 y/o. speaking 🇩🇪/🇬🇧. meows and awoos a lot.


as seen on the fediverse and the birdsite.


for DMs:
message me on matrix (@luna:fef.moe) or discord (@trenchcoatraccoons)


new pfp: toon me! picrew

old pfp: picrew #1322863

:3


lexi
@lexi
  1. i wrote a comment saying "get all Set-Cookie headers" to try to get gh copilot to do it for me because i have no clue how to get multiple with node-fetch
  2. gh copilot suggested res.header.get('set-cookie')
  3. i tried it and realized that the cookies are comma-separated
  4. i start writing some spaghetti code to untangle the cookies
  5. gh copilot perfectly guesses what i wanted to do and completes it
  6. i checked, and copilots guess was indeed perfect
  7. i insert a comment saying "for some g"
  8. gh copilot suggested "for some god forsaken reason, the cookies are separated by a comma, but cookie values can have commas in them, so we need to do this"
  9. my ide spellcheck pointed out that it is "godforsaken" and not "god forsaken" and offers to fix it with one click
  10. i write "computers" and gh copilot guesses exactly what i wanted to write

thinking rocks are black magic

the code that it wrote
let cookieMap = new Map<string, string>()
// for some god forsaken reason, the cookies are separated by a comma
// but cookie values can have commas in them, so we need to do this
cookies.split(/ *[;,] */)
    .filter(e=>e.includes('='))
    .map(e=>e.split('='))
    .map(([k, v]) => cookieMap.set(k, v))

and yes, this breaks every cookie that contains commas, but i dont need them either way lol


You must log in to comment.

in reply to @lexi's post:

i only screenshotted the last suggestion because i did not want to clutter the post but this actually happened exactly like this. and yes, the headers are genuinely joined by commas

Pinned Tags