Skip to content

Instantly share code, notes, and snippets.

View nmquebb's full-sized avatar

Nick Quebbeman nmquebb

  • Chicago, IL
View GitHub Profile
import Link from 'next/link';
import { useRouter } from 'next/router';
import { api } from '@chapterchat/sdk';
import { useAuth } from 'lib/stores/auth_store';
import { Logo } from 'svg';
import { Button } from '../button';
import {
AvatarIcon,
CaretDownIcon,
@nmquebb
nmquebb / Button.styles.ts
Last active December 1, 2021 01:57
React Native light/dark theme styles
export const styles = {
base: StyleSheet.create({
button: { padding: 20 },
}),
light: StyleSheet.create({
button: { background: 'blue', color: 'white' },
}),
dark: StyleSheet.create({
@nmquebb
nmquebb / gen.ts
Last active January 26, 2022 22:58
asd
import { SchemaFormElements, SchemaFormProperties, SchemaFormType } from 'jtd';
import { get, set } from 'lodash';
import { Merge } from 'type-fest';
const RE_TAG = /\{+\s*(.*?)\s*\}+/g;
const RE_THIS = /this.?/;
const RE_WITH = /#with\s+/;
const RE_EACH = /#each\s+/;
const RE_OPTIONAL = /#(if|unless)\s+/;
@nmquebb
nmquebb / db.ts
Last active March 17, 2023 17:38
const fileSchema = z.union([
z.object({
type: z.literal('image'),
width: z.number().int(),
height: z.number().int(),
}),
z.object({
type: z.literal('pdf'),
pages: z.number().int(),
}),
@nmquebb
nmquebb / json-agg.ts
Last active August 26, 2025 02:31
json agg for drizzle
export function jsonAgg<T extends Record<string, AnyColumn>>(select: T) {
const chunks: SQL[] = [];
Object.entries(select).forEach(([key, column], index) => {
if (index > 0) chunks.push(sql`,`);
chunks.push(sql.raw(`'${key}',`), sql`${column}`);
});
return sql<InferColumnsDataTypes<T>[]>`
coalesce(