Skip to content

Instantly share code, notes, and snippets.

View DannyStreur's full-sized avatar

Danny Streur DannyStreur

View GitHub Profile
@t3dotgg
t3dotgg / try-catch.ts
Last active December 7, 2025 23:13
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@cayter
cayter / LICENSE
Last active November 9, 2025 11:12
Drizzle ORM Type-Safe Repository With PgTable
MIT License
Copyright (c) 2022-present, cayter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@stevenaanen
stevenaanen / convert-casing-after-prisma-pull.mjs
Last active November 7, 2023 14:52
Transform Prisma Schema to js-friendly names
// @ts-check
/*
* Run using `node convert-casing-after-prisma-pull.mjs` after installing `change-case` in your workspace.
* Then pipe your schema into it.
*
* Script will normalize the model names, field names and enums.
* It should not affect your database schema, only the generated js client from Prisma.
*
* Tip: after processing, run `prisma format` on the file.
*/
@wycks
wycks / Monokai-PhpStorm-Base.xml
Last active December 10, 2015 06:08
Monokai theme for PhpStorm that fits closer to the sublime2 soda dark version.
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="Monokai-Custom" version="1" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="16" />
<option name="EDITOR_FONT_NAME" value="Consolas" />
<colors>
<option name="CARET_COLOR" value="f8f8f0" />
<option name="CARET_ROW_COLOR" value="3e3d32" />
<option name="CONSOLE_BACKGROUND_KEY" value="272822" />
<option name="GUTTER_BACKGROUND" value="272822" />