Skip to content

Instantly share code, notes, and snippets.

View djdmbrwsk's full-sized avatar

Dan Dombrowski djdmbrwsk

  • Lang-kiss-ter, PA
View GitHub Profile
@djdmbrwsk
djdmbrwsk / prisma-extension-idle-disconnect.ts
Created June 14, 2023 01:18
Prisma extension that will automatically disconnect the Prisma client after a period of inactivity.
import { Prisma, PrismaClient } from '@prisma/client';
type PrismaClientWithQueryLogEvents = PrismaClient<{
log: {
level: 'query';
emit: 'event';
}[];
}>;
type PrismaClientIdleDisconnectEx = {
@djdmbrwsk
djdmbrwsk / ng-model-dynamic.js
Created July 16, 2015 18:29
Dynamically set ng-model with an expression
(function () {
/*
PROBLEM:
<input type="text" ng-model="{{someExpressionThatReturnsTheStringYouWant}}">
^ THIS WON'T WORK
SOLUTION:
<input type="text" ng-model-dynamic="{{someExpressionThatReturnsTheStringYouWant}}">
@djdmbrwsk
djdmbrwsk / boston-3mi-buffer.geojson
Last active September 28, 2020 11:54
Result of buffering a Boston lat/lon 3 miles using the turf library
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.