Skip to content

Instantly share code, notes, and snippets.

@varna
varna / wrangler-d1-migrations.md
Last active April 12, 2024 14:35
Idea on making Cloudflare wrangler CLI for D1 migrations better experience.

Wrangler D1 Migrations

Currently, D1 migrations are a bit yucky, because of:

  • scary defaults
  • not knowing on which db it is being ran
  • package.json scripts bloat

Scary defaults

EDIT: This happended on wrangler@3.48.0. This behaviour is gone on 3.50.0.

@varna
varna / SaveTextCommand.js
Created January 23, 2019 12:14
The old ways...
function CommandBase(value) {
this.value = value;
}
CommandBase.prototype.GetString = function() {
return this.value;
};
function SaveTextCommand(value, prefix = 'save: ') {
CommandBase.call( this, value );
@varna
varna / index.mjs
Created April 4, 2018 12:21
Multer with S3
import express from 'express'
import compression from 'compression'
import multer from 'multer'
import upload from './upload.mjs'
const uploadFile = upload.single('uploadedfile')
const app = express()
app.use(compression())
@varna
varna / Gallery.vue
Created September 4, 2017 13:34
Nuxt plugin for v-img directive