Skip to content

Instantly share code, notes, and snippets.

@critical
critical / opencode-anthropic-system-prompt.patch
Last active January 14, 2026 23:30
OpenCode fix for Anthropic plans
diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts
--- a/packages/opencode/src/session/system.ts
+++ b/packages/opencode/src/session/system.ts
@@ -27,12 +27,12 @@
}
export function provider(model: Provider.Model) {
+ if (model.providerID.includes("anthropic") && model.api.id.includes("claude")) return []
if (model.api.id.includes("gpt-5")) return [PROMPT_CODEX]
if (model.api.id.includes("gpt-") || model.api.id.includes("o1") || model.api.id.includes("o3"))
import { Effect, Function } from "effect";
import { Pipeable, pipeArguments } from "effect/Pipeable";
import { Predicate, Refinement } from "effect/Predicate";
import { Profil, UnAuthorized } from "../Profil";
import { UserSessionService } from "../UserSession/UserSessionServiceTag";
export interface Policy<A, E = never, R = never> extends Pipeable {
run: (a: A) => Effect.Effect<boolean, E, R>;
readonly _tag: "Policy";
}
@anglinb
anglinb / runAwaitingScopeClose.ts
Created February 28, 2025 21:38
Shows how to invoke a scoped effect in a cloudflare worker and return the result while keeping it alive for the scope to close.
import { Duration, Effect, Either, Scope, Cause } from 'effect';
// This function allows you call to a scoped effect, return the response
// then use the ctx.waitUntil api to ensure the worker continues
// to run until the scope is done closing. It handles, success,
// failures and defects.
const runAwaitingScopeClose =
<Input, S extends Response, E>(effect: (input: Input, env: Env, ctx: ExecutionContext) => Effect.Effect<S, E, Scope.Scope>) =>
(input: Input, env: Env, ctx: ExecutionContext): Promise<Response> => {
@orzklv
orzklv / readme.md
Last active February 15, 2026 22:40
How to migrate from homebrew to Nix package manager by Orzklv! Moved to: https://nix-darwin.uz/guide/

How to migrate from Homebrew to Nix

#homebrew #brew #nix #nixos

I'll be honest with ya'll, you don't wanna get away from Homebrew completely, yes, I'll explain!

I've been using Nix package manager in all my MacOS machines about 3-4 months and I always kept Homebrew installed. You see, Nix is a very good package manager and with its home-manager, it becomes a good config farm as well. However, installing & managing GUI & unfree apps via Nix has been a quite painful experience for me. Sometimes, it wouldn't run properly, crash or wouldn't even start. Also, Nix doesn't have most of GUI packages that Homebrew has. Therefore, I keep homebrew and use it only for its "casks" registry to install GUI & unfree apps whereas having nix to manage dot file configurations and cli apps.

/**
* @category models
* @since 1.0.0
*/
export interface SqliteClient extends Client.Client {
readonly [TypeId]: typeof TypeId
readonly config: SqliteClientConfig
/** Not supported in d1 */
@cayter
cayter / LICENSE
Last active May 4, 2026 09:22
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:
@arekmaz
arekmaz / drizzle-effect-schema.ts
Last active December 31, 2025 13:46
drizzle-effect-schema
import * as S from "@effect/schema/Schema";
import { Assume, Column, Equal, Table, getTableColumns, is } from "drizzle-orm";
import {
MySqlChar,
MySqlVarBinary,
MySqlVarChar,
} from "drizzle-orm/mysql-core";
import { PgArray, PgChar, PgUUID, PgVarchar } from "drizzle-orm/pg-core";
import { SQLiteText } from "drizzle-orm/sqlite-core";
import { Simplify } from "effect/Types";
@amiorin
amiorin / README.md
Last active January 15, 2026 09:16
How to configure Home Row Mods with KMonad on macOS

Intro

Karabiner and KMonad are great open source software. Don't forget to support the authors and contributors.

If you want to try home row mods on OSX, don't use Karabiner but KMonad. KMonad is harder at the beginning but then it is easier than Karabiner. Creating layers in KMonad is trivial and without drawbacks, while it is impossible in Karabiner without drawbacks.

You need to compile a PR of the project. Install https://github.com/pqrs-org/Karabiner-DriverKit-VirtualHIDDevice/releases/download/v2.1.0/Karabiner-DriverKit-VirtualHIDDevice-2.1.0.pkg

@kallewoof
kallewoof / bitcoin-rpc.ts
Created May 11, 2021 10:14
Typescript bindings for Bitcoin Core's RPC command
export type Dict<T> = { [type: string]: T };
const Do = async <Retval>(cmd: string, ...args: (string | boolean | number | object | null | undefined)[])
: Promise<Retval> => Promise.reject();
// The above Do command should asynchronously call Bitcoin's RPC interface, e.g. like the bcrpc package.
/////////////////////////////////////////
// RPC: abandontransaction
//
@sdondley
sdondley / tmux split-window subcommand.md
Last active May 5, 2026 15:16
Super Guide to the split-window tmux Subcommand (and Beyond)

Super Guide to the split-window tmux Subcommand (and Beyond)

Guide overview

tmux, like other great software, is deceptive. On the one hand, it's fairly easy to get set up and start using right away. On the other hand, it's difficult to take advantage of tmux's adanced features without spending some quality alone time with the manual. But the problem with manuals is that they aren't geared toward beginners. They are geared toward helping seasoned developers and computer enthusiasts quickly obtain the