Skip to content

Instantly share code, notes, and snippets.

View BananaAcid's full-sized avatar

Nabil Redmann BananaAcid

View GitHub Profile
@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
*/
@BananaAcid
BananaAcid / Readme.md
Last active October 5, 2024 20:05
Nuxt module - simple base with auto-import

nuxt module base

A simple start with auto importing the common file types

setup

  1. follow the simple setup at nuxt.com > Modules
  2. copy the other files (at least magicImports.ts, optionally module.ts) from below to auto-import the common filetypes
  3. npm i fast-glob ... is required, as long as node:fs > glob is still experimental

free-space-json-api-server

Expose basic disk usage

{
    "free": 15024480256,
    "available": 15024480256,
    "freePercent": 3.01,
    "warnMin": false,
@BananaAcid
BananaAcid / app.json
Created August 2, 2024 15:48
dokku health check in nuxt
{
"scripts": {
"dokku": {
"predeploy": "cd app && npm install && npm run build"
}
},
"healthchecks": {
"web": [
{
"type": "startup",
@BananaAcid
BananaAcid / vscode user keybindings.json
Created July 26, 2024 08:08
Comment Keybindings for VSCode
[
{ "key": "cmd+shift+7", "command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly" },
{ "key": "cmd+shift+8", "command": "editor.emmet.action.toggleComment",
"when": "editorTextFocus && !editorReadonly" },
]
@BananaAcid
BananaAcid / Readme.md
Created July 18, 2024 21:59
vite disable minify

vite.config.js

in defineConfig

{
    build: {
        minify: false // or "terser" but you need terser installed
    }
}
@BananaAcid
BananaAcid / Readme.md
Last active July 18, 2024 21:25
kaboomjs / kaplay with nuxt
@BananaAcid
BananaAcid / unity_uninstall.ps1
Last active July 13, 2024 07:50
quickly uninstall all unity installations / WIN
ls "C:\Program Files\Unity*\Editor\Uninstall.exe" | % fullname |% { &$_ /S /allusers _="$_" }
# just reinstall the one you need.
# /S is silent
# /allusers make sure it is really uninstalled, and its icon as well for all users
# _ to not unpack the installer or something, at least the uninstall is speed up
# ref: https://nsis-dev.github.io/NSIS-Forums/html/t-66750.html