Skip to content

Instantly share code, notes, and snippets.

View BananaAcid's full-sized avatar

Nabil Redmann BananaAcid

View GitHub Profile
@BananaAcid
BananaAcid / host-info.js
Last active April 23, 2025 15:46
simple hostname info in nodejs
import { createServer } from 'node:http';
import { execSync } from 'node:child_process';
const server = createServer(async function (req, res) {
Object.entries({
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': '*',
@BananaAcid
BananaAcid / getVersionFromNPM.mjs
Last active April 21, 2025 23:51
simple version check on npm
import package from './package.json' with { type: "json" };
let version = await fetch(`https://registry.npmjs.com/${package.name}/latest`).catch(_=>undefined).then(d => d?.json?.()).then(({version})=>version).catch(_=>undefined);
console.log(`Newest version is ${ version ?? 'unknown' }`);
@BananaAcid
BananaAcid / Readme.md
Created April 20, 2025 17:29
npm shell to pwsh

#donotForgetAgain

set npm shell to be powershell 7+

npm config set script-shell pwsh --global 
@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: