Skip to content

Instantly share code, notes, and snippets.

@denizdogan
denizdogan / op_leaks.ts
Created June 13, 2023 02:46
Deno: Log leaking ops
setInterval(() => {
console.log(Object.fromEntries(
Object.entries(Deno.metrics()["ops"]).filter(([k, v]) =>
Object.values(v).some((y) => y)
).map(([op, metrics]) => [
op,
metrics.opsDispatchedAsync - metrics.opsCompletedAsync,
]).filter(([op, diff]) => diff !== 0),
));
console.log(Deno.resources());
@denizdogan
denizdogan / crud_me_up.py
Created September 22, 2022 11:14
Never write Django again
# i wrote this as a joke, don't worry
# ...but it actually works
from django.db.models import QuerySet
from django.shortcuts import get_object_or_404
from ninja import Router, Schema
from pydantic.typing import Dict, Union, Literal, Optional, Type
from myproject.people.models import Person
#!/usr/bin/env bash
set -e
# WARNING! USE AT YOUR OWN RISK! Automatically downloads and unpacks the latest
# Tizen Emby app to your USB drive and then ejects the drive for you.
# Requirements:
# - curl
# - diskutil