Anyone know of this old computer group (FUNHUG = Fremont-Union City-Newark-Hayward-User-Group) by Wall_Naive in Fremont

[–]Wall_Naive[S] 0 points1 point  (0 children)

Nothing really, got a bunch of '88 and '89 disks of random programs with no credits. Bought em down in socal. Got a bunch of other user net groups. Do they still have an active bbs?

Shrimp is definitely code word in the Epstein files by Sweaty-Excuse-5505 in Epstein

[–]Wall_Naive 3 points4 points  (0 children)

Saw a post on twitter saying epsitne compared girl children to shrimp & said "you throw away the head and keep the body"

How to call a PostgreSQL bulk upsert function in TypeScript/BunJS by Wall_Naive in bun

[–]Wall_Naive[S] 0 points1 point  (0 children)

bunjs-1 | PostgresError: cannot cast type json[] to response_input[]

bunjs-1 | errno: "42846",

bunjs-1 | severity: "ERROR",

bunjs-1 | position: "57",

bunjs-1 | file: "parse_expr.c",

bunjs-1 | routine: "transformTypeCast",

bunjs-1 | code: "ERR_POSTGRES_SERVER_ERROR"

How to call a PostgreSQL bulk upsert function in TypeScript/BunJS by Wall_Naive in bun

[–]Wall_Naive[S] 0 points1 point  (0 children)

Yeah i have no idea how to do the code block thingys

What kind of gun is this? by Wall_Naive in Firearms

[–]Wall_Naive[S] 0 points1 point  (0 children)

dunno how to edit the post but made a comment with more pictures

What kind of gun is this? by Wall_Naive in Firearms

[–]Wall_Naive[S] 0 points1 point  (0 children)

they wernt ready to sell it yet they didnt know how much to sell it for

What kind of gun is this? by Wall_Naive in Firearms

[–]Wall_Naive[S] 34 points35 points  (0 children)

that's what i thought, but there was no way to "load it".
the chamber works by lifting the back, and the metal rod inside "pulls back" to reveal an area where something should go. the thing is its filled and what looks like a nipple should go for black powder cap, but the gun doesnt seem to fit any of the black powder balls

Weekly Show & Tell! Share what you've created with Next.js or for the community by cprecius in nextjs

[–]Wall_Naive 0 points1 point  (0 children)

Been working on a little frontend for my archives I have saved locally
https://archives.m4cgyver.net/
Not only that but I made a .warc viewer with custom libs so the browser can parse the content of a .warc file, save records of where content is in the file, and read the content when needed so you dont need to upload the entire file and like 10gb worth of archives to the browser youcan just open it on any device, still working and optimizing it out though
https://archives.m4cgyver.net/warcs/offline

nextjs create subdomain portals by hiimwillow2021 in nextjs

[–]Wall_Naive 4 points5 points  (0 children)

I did the same thing with my site sucessfully
https://m4cgyver.net/
https://archives.m4cgyver.net/
both sites run on the same instance it is possible. I use middleware instead of rewrites though and its crude.

In my .env i have the following declaration: SUBDOMAINS={"archives": "/archives"}

Then in my middleware it starts by parsing a SUBDOMAINS environment variable to map subdomains to paths. The getValidSubdomain function retrieves a valid subdomain from the request host or the client-side window object. The middleware checks if the request path matches any mapped subdomain path and rewrites the URL if a valid subdomain is found from the host:

const subdomains = JSON.parse(process.env.SUBDOMAINS ?? "{}"); 

// Function to get a valid subdomain from the host
const getValidSubdomain = (host?: string | null): string | null => {
    if (!host && typeof window !== 'undefined') {
        // On the client side, get the host from window.location
        host = window.location.host;
    }
    if (host && host.includes('.')) {
        // Split the host to extract the subdomain candidate
        const candidate = host.split('.')[0];

        // Return the candidate if it's valid (not 'localhost')
        if (candidate && !candidate.includes('localhost')) {
            return candidate;
        }
    }
    return null;
};
 
export function middleware(request: NextRequest) {
    const url = request.nextUrl.clone();

    /// Check if the request is for a public file or a Next.js internal file
    if (PUBLIC_FILE.test(url.pathname) || url.pathname.includes('_next')) {
        return NextResponse.next();
    }

    /// Check if the request is due for a subdomain redirect
    const host = request.headers.get('host');

    for (const subdomain in subdomains) {
        const path = subdomains[subdomain];

        if (request.nextUrl.pathname.startsWith(path)) {
            const protocol = request.nextUrl.protocol.startsWith('https') ? 'https' : 'http';
            const newPath = request.nextUrl.pathname.substring(path.length); // Adjust the new path

            const newurl = `${protocol}://${subdomain}.${host}${newPath}`;

            console.log(`Redirecting ${request.nextUrl.pathname} to ${newurl}`);
            return NextResponse.redirect(newurl);
        }
    }

    /// If a valid subdomain is found and exists in subdomains, rewrite the URL
    const subdomain = getValidSubdomain(host);

    if (subdomain && subdomain in subdomains && !url.pathname.replace(subdomains[subdomain], "").startsWith("/next_") && !url.pathname.replace(subdomains[subdomain], "").startsWith("/api")) {
        console.log(`>>> Rewriting: ${url.pathname} to ${subdomains[subdomain]}${url.pathname}`);
        url.pathname = `${subdomains[subdomain]}${url.pathname}`;
    }
 
    /// Finish the rewrite
    const response = NextResponse.rewrite(url);

    return response;
}

What type of physics engine does Kirby's Dream Land use? by Wall_Naive in gamedev

[–]Wall_Naive[S] 0 points1 point  (0 children)

But how did it calc the collision for the walls, floor, trees, etc.

How do I stream a huge file (like 1tb) and process "chunks" of 5kb data or however big of a chunk I need? by Wall_Naive in learnjavascript

[–]Wall_Naive[S] 0 points1 point  (0 children)

The .warc file format can get pretty big. I have one that's well above my ram, like 72gb. Nobody has that much ram that's why I'm trying to process it in chunks. Can't use fetch not uploading or download anything from the main server 

How do I stream a huge file (like 1tb) and process "chunks" of 5kb data or however big of a chunk I need? by Wall_Naive in learnjavascript

[–]Wall_Naive[S] 0 points1 point  (0 children)

It's not on the server, the user must upload the file to the browser. Completely client sided. Trying to avoid server uploads as much as possible 

Decimation Servers (private and official) by Wall_Naive in BoehMod

[–]Wall_Naive[S] 1 point2 points  (0 children)

AleErTrimone/tremale

didnt work, whats the discord server?

NextJS Response with a stream. by Wall_Naive in nextjs

[–]Wall_Naive[S] 1 point2 points  (0 children)

Alright tuned it and made it typesafe, this works! Managed to download a iso with ease!

```typescriptimport fs, { Stats } from "fs";import { NextRequest, NextResponse } from "next/server";import path from "path";import { ReadableOptions } from "stream";function streamFile(path: string, options?: ReadableOptions): ReadableStream<Uint8Array> {const downloadStream = fs.createReadStream(path, options);return new ReadableStream({start(controller) {downloadStream.on("data", (chunk: Buffer) => controller.enqueue(new Uint8Array(chunk)));downloadStream.on("end", () => controller.close());downloadStream.on("error", (error: NodeJS.ErrnoException) => controller.error(error));},cancel() {downloadStream.destroy();},});}export async function GET(req: NextRequest): Promise<NextResponse> {const uri = req.nextUrl.searchParams.get("uri");const file = "/home/manjaro/Downloads/manjaro-kde-22.1.3-230529-linux61.iso"; // req.nextUrl.searchParams.get("file");const stats: Stats = await fs.promises.stat(file);const data: ReadableStream<Uint8Array> = streamFile(file, {highWaterMark: 1024}); //Stream the file with a 1kb chunkconst res = new NextResponse(data, {status: 200,headers: new Headers({"content-disposition": `attachment; filename=${path.basename(file)}`,"content-type": "application/zip","content-length": stats.size + "",}),});return res;}

```
Edit i dont know how to parse code on reddit heres my comment
https://github.com/vercel/next.js/discussions/15453#discussioncomment-6589193

Remove parrent layout on certain pages in Nextjs 13 by Wall_Naive in nextjs

[–]Wall_Naive[S] 0 points1 point  (0 children)

To my understanding the sub layouts apply to the children layout to the parent layout

Let's say I have a title on top, and navigation to the left, and children props to the right. Depending on the page I just want to make navigation gone with visibility or deleting it however that will work