Skip to content

Instantly share code, notes, and snippets.

View Aulos's full-sized avatar

Paweł Zubrycki Aulos

  • Dash Social
  • Warsaw, Poland
  • 22:24 (UTC +01:00)
View GitHub Profile
@fl0wo
fl0wo / multi-db-migrate-turso-drizzle.ts
Created March 17, 2025 00:10
script that lists all multi-tenant databases and applies schema migrations using Turso and Drizzle.
import { createClient } from "@tursodatabase/api";
import { createClient as createTursoClient } from "@libsql/client"
import {migrate} from "drizzle-orm/libsql/migrator";
import {drizzle} from "drizzle-orm/libsql";
// THE SCHEMA OF THE ORG DBs (not the main one)
import * as schema from "../drizzle/org-schemas";
import {DEFAULT_API_TOKEN, TURSO_API_TOKEN} from "./secrets";
const listDBs = async () => {
@paulirish
paulirish / bling.js
Last active January 30, 2026 14:23
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
var http = require('http'),
toobusy = require('toobusy');
console.log("Maximum allowed event loop lag: " + toobusy.maxLag(50) + "ms");
function processRequest(res, num, startTime) {
if (!startTime) startTime = new Date();
if (num === undefined) {
return process.nextTick(function() {