(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// schema/entities/base.ts | |
export const getBaseEntityProps = () => ({ | |
id: uuid("id") | |
.default(sql`gen_random_uuid()`) | |
.primaryKey(), | |
createdAt: timestamp("created_at", { precision: 3 }).notNull().defaultNow(), | |
}); | |
export const getOwnedBaseEntityProps = () => ({ |
import { and, type DBQueryConfig, eq, type SQLWrapper } from "drizzle-orm"; | |
import { drizzle } from "drizzle-orm/postgres-js"; | |
import postgres, { type Sql } from "postgres"; | |
import { type AnyArgs } from "@/common"; | |
import { | |
type DbClient, | |
type DbTable, | |
type DeleteArgs, |
/** | |
* @example | |
* type P = Permutation<1 | 2 | 3> | |
* // [1, 2, 3] | [1, 3, 2] | [2, 1, 3] | [2, 3, 1] | [3, 1, 2] | [3, 2, 1] | |
*/ | |
export type Permutation<U, T = U> = [U] extends [never] | |
? [] | |
: T extends unknown | |
? [T, ...Permutation<Exclude<U, T>>] | |
: never |
#! /bin/bash | |
# | |
# Diffusion bilibili live avec ffmpeg | |
# Make sure you have FFmpeg installed in your mac | |
# list avfoundation devices | |
ffmpeg -f avfoundation -list_devices true -i "" | |
# change the param after `-i` and `-f flv` |
// Sets the default text formatting & responsive sizes //---------------- | |
$font-size-base: 1rem; | |
$font-size-sm: .875rem; | |
$font-size-h1: 2.25rem; | |
$font-size-h2: 2rem; | |
$font-size-h3: $font-size-base; | |
$font-size-ingress: 1.5rem; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/bin/sh | |
echo Install all AppStore Apps at first! | |
# no solution to automate AppStore installs | |
read -p "Press any key to continue... " -n1 -s | |
echo '\n' | |
echo Install and Set San Francisco as System Font | |
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)" | |
echo Install Homebrew, Postgres, wget and cask | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
{{ variable|stringformat:"02d" }} |