Skip to content

Instantly share code, notes, and snippets.

View andreypopp's full-sized avatar
🏠
Working from home

Andre Popp andreypopp

🏠
Working from home
View GitHub Profile
diff --git a/prisma/migrations/20230213210924_add_enum_statuses_to_email_verification_and_credentials_restore/migration.sql b/prisma/migrations/20230213210924_add_enum_statuses_to_email_verification_and_credentials_restore/migration.sql
index 698f38d..c3b7952 100644
--- a/prisma/migrations/20230213210924_add_enum_statuses_to_email_verification_and_credentials_restore/migration.sql
+++ b/prisma/migrations/20230213210924_add_enum_statuses_to_email_verification_and_credentials_restore/migration.sql
@@ -23,8 +23,9 @@ ALTER TABLE "EmailVerification" ADD COLUMN "triesLeft" INTEGER NOT NULL DEFAULT
ALTER TABLE "UserEmailCredentialsRestore" DROP CONSTRAINT "UserEmailCredentialsRestore_userEmailCredentialsId_fkey";
-- MANUAL MIGRATION INSTRUCTIONS
-ALTER TABLE "UserEmailCredentialsRestore" ADD COLUMN "credentialsId" TEXT NOT NULL;
+ALTER TABLE "UserEmailCredentialsRestore" ADD COLUMN "credentialsId" TEXT NULL;
/** expressions */
declare class expr<t> { #witness: t; }
/** scopes */
type fields = {[name: string]: expr<any> | scope<any, any>};
type exprfields = {[name: string]: expr<any>};
type scope<f extends fields, a extends fields=never> = { [k in keyof f]: f[k]; }
diff --git a/nextjs-api/types.ts b/nextjs-api/types.ts
index c7a7b7b..bff8e10 100644
--- a/nextjs-api/types.ts
+++ b/nextjs-api/types.ts
@@ -28,29 +28,21 @@ export interface MakeEndpointConstruct<C, R, U, D> {
// TODO: How to make optional types work with generics?!
export interface EndpointConstructClient<C, R, U, D, URLParams> {
// FIXME - this is not working
- post?: C extends undefined
- ? undefined
type CmdArgsResult<C> = C extends Cmd<[], null, infer _O, infer _C>
? []
: C extends Cmd<infer A, null, infer _O, infer _C>
? [...{ [K in keyof A]: ArgResult<A[K]> }]
: C extends Cmd<[], infer RA, infer _O, infer _C>
? WithArgRestResult<[], RA>
: C extends Cmd<infer A, infer RA, infer _O, infer _C>
? WithArgRestResult<[...{ [K in keyof A]: ArgResult<A[K]> }], RA>
: never;
{
let collect state acc buf =
let should_collect =
match state with
| `empty -> true
| `start | `non_empty -> Buffer.length buf > 0
in
if should_collect
then (

Suggestions/Questions

  • Suggestion: get rid of unused code

    I suggest to turn on noUnusedParameters and noUnusedLocals, then cleanup all the instances.

  • Suggestion: get rid of any, as

Need to review usages of any and EXPR as TYPE. The latter in most cases

path = []
dirs = set()
size = {}
lines = [line.strip() for line in open("./aoc7.data")]
while lines:
line = lines.pop(0)
if line == "$ cd /": line = "$ cd C:"
if line == "$ cd ..":
path.pop()
elif line.startswith("$ cd "):
<!DOCTYPE html>
<html>
<head>
<script>
window.ASAPConfig = {"basePath":""};
window.ASAPBootConfig = {"basePath":"","initialPath":"/hello/message","js":"/__static/__main__-524CBTGD.js","css":"/__static/__main__-M2L2B7QS.css"};
</script>
<script type="module" src="/__static/__main__-524CBTGD.js"></script>
<link rel="stylesheet" href="/__static/__main__-M2L2B7QS.css"/>
</head>
export declare class TreeCursor implements SyntaxNodeRef {
type: NodeType;
get name(): string;
from: number;
to: number;
private stack;
private bufferNode;
private yieldNode;
private yieldBuf;
private yield;
diff --git a/makefile b/makefile
index bf26179..6f02914 100644
--- a/makefile
+++ b/makefile
@@ -87,8 +87,13 @@ else
endif
endif
ifeq ($(i_FFI),2)
+ifeq ($(shell command -v pkg-config 2>&1 > /dev/null && pkg-config --exists libffi && echo $$?),0)
+ i_LD_LIBS += $(shell pkg-config --libs libffi)