Skip to content

Instantly share code, notes, and snippets.

View BananaAcid's full-sized avatar

Nabil Redmann BananaAcid

View GitHub Profile
@BananaAcid
BananaAcid / Readme.md
Last active April 10, 2025 20:29
JavaScript: node:parseEnv sucks really badly.

JavaScript: node:parseEnv sucks really badly.

This is my version.

Loads all ENV vars to the process.env

  • ignore comments (any amount of spaces then #)
  • any = after the first is part of the value
  • keys will always be uppercase and spaces replaced with _
@BananaAcid
BananaAcid / Readme.md
Last active April 8, 2025 23:59
BOLT.diy installation

BOLT.diy installation

image

install

  1. install nodejs

  2. create a folder bolt.diy.dev and open the terminal in that folder

@BananaAcid
BananaAcid / Readme.md
Last active April 3, 2025 13:11
Powershell Spamtest per KI im eigenen Outlook

Powershell Spamtest per KI im eigenen Outlook

Starten

in der Powershell

& ./test-spam.ps1

oder

@BananaAcid
BananaAcid / Readme.md
Created February 10, 2025 11:57
HTTPie cert error

Make python use system certificates

python -m pip install pip-system-certs

Error was:

https: error: SSLError: HTTPSConnectionPool(host='wikipedia.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1018)'))) while doing a GET request to URL: https://wikipedia.com/

@BananaAcid
BananaAcid / Readme.md
Created January 23, 2025 15:31
VUE: access each element in default slot

MyElement.vue

<template v-for="item in $slots.default?.()" :key="item">
  <p>
    <component :is="item" /> <!-- wrapps all child elements in default slot -->
  </p>
</template>

main.vue

@BananaAcid
BananaAcid / Readme.md
Last active January 21, 2025 14:45
Setup for Web Testing (Puppeteer)
  1. download nodeJS
  2. create empty folder, open it with vscode
  3. vscode -> terminal
  4. npm init
  5. npm i puppeteer tsx

create a index.ts:

@BananaAcid
BananaAcid / imap-auth.mjs
Created October 25, 2024 16:48
IMAP Auth for nodejs
// npm install imapflow
import { ImapFlow } from 'imapflow';
const config = {
host: 'ethereal.email',
port: 993,
secure: true,
auth: {}
};
@BananaAcid
BananaAcid / session_handling.txt
Created October 10, 2024 12:24
Nuxt session handling
/composables/useSess.ts
import {useSession} from h3
export default useSess(event)
return useSession(event, useRunimeConfig().session);
/nuxt.config.ts
@BananaAcid
BananaAcid / callFnInThread.js
Last active October 5, 2024 19:51
create an in-memory worker by passing a function or promise and be able to await its return-result, args must be serializable
/**
* create an in-memory worker by passing a function or promise and be able to await its return-result, args must be serializable
*
* @author Nabil Redmann
* @license MIT
*
* @see https://gist.github.com/BananaAcid/b8e3d609c5655301eccaeb44c9df9037
* @reference https://stackoverflow.com/a/19201292/1644202
*/