Skip to content

Instantly share code, notes, and snippets.

View Flowko's full-sized avatar
💭
I may be slow to respond.

Younes Barrad Flowko

💭
I may be slow to respond.
View GitHub Profile
// db/schema/auth.ts
import {
int,
timestamp,
mysqlTable,
primaryKey,
varchar,
text
} from "drizzle-orm/mysql-core"
import type { AdapterAccount } from "@auth/core/adapters"
@atinux
atinux / sse.ts
Last active January 21, 2026 11:23
SSE endpoint example with Nuxt 3
// ~/server/api/sse.ts
export default defineEventHandler(async (event) => {
if (!process.dev) return { disabled: true }
// Enable SSE endpoint
setHeader(event, 'cache-control', 'no-cache')
setHeader(event, 'connection', 'keep-alive')
setHeader(event, 'content-type', 'text/event-stream')
setResponseStatus(event, 200)
@bradtraversy
bradtraversy / mern-server-setup.md
Last active February 5, 2026 06:33
Setup Ubuntu & Deploy MERN app

Linux Server Setup & MERN App Deployment

These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.

Create an account at Linode

Click on Create Linode

Choose your server options (OS, region, etc)

SSH Keys

@davidbanham
davidbanham / gist:1186032
Created September 1, 2011 12:02
Dynamically generate a file download in express without touching the filesystem
var express = require('express');
var app = require('express').createServer();
app.listen('3030');
app.get('/', function(req, res) {
res.contentType('text/plain');
res.send('This is the content', { 'Content-Disposition': 'attachment; filename=name.txt' });
});