Skip to content

Instantly share code, notes, and snippets.

View oliveryasuna's full-sized avatar

Oliver Yasuna oliveryasuna

  • Boston, MA
  • 05:15 (UTC -04:00)
View GitHub Profile
@oliveryasuna
oliveryasuna / types.ts
Created April 24, 2025 17:39
pg Type Parsers
import {UserPermissionEnum} from '@poop/db';
import pg from 'pg';
import {LocalDate, LocalDateTime, LocalTime, ZonedDateTime} from '@js-joda/core';
type pgBOOL = boolean;
type pgBYTEA = Buffer;
type pgCHAR = string;
type pgINT8 = number;
type pgINT2 = number;
type pgINT4 = number;
@oliveryasuna
oliveryasuna / conditions.ts
Last active April 24, 2025 17:35
Kysely Repository (incomplete)
import type {AnyTable} from './types';
import type {ReferenceExpression} from 'kysely';
const UNARY_COMPARISON_OPERATORS_COMMON = (['is null', 'is not null'] as const);
const UNARY_COMPARISON_OPERATORS_BOOLEAN_ONLY = (['is true', 'is not true', 'is false', 'is not false', 'is unknown', 'is not unknown'] as const);
const UNARY_COMPARISON_OPERATORS = [...UNARY_COMPARISON_OPERATORS_COMMON, ...UNARY_COMPARISON_OPERATORS_BOOLEAN_ONLY] as const;
type UnaryComparisonOperatorCommon = (typeof UNARY_COMPARISON_OPERATORS_COMMON[number]);
type UnaryComparisonOperatorBooleanOnly = (typeof UNARY_COMPARISON_OPERATORS_BOOLEAN_ONLY[number]);
type UnaryComparisonOperator<T> = (T extends boolean
@oliveryasuna
oliveryasuna / slide-deck.html
Created March 9, 2022 17:53
CSS-only Slide Deck
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Demo styles. -->
<style>
body {
body {
display: flex;