Skip to content

Instantly share code, notes, and snippets.

View crisu83's full-sized avatar
🎩
Coding

Christoffer Niska crisu83

🎩
Coding
View GitHub Profile
@crisu83
crisu83 / acolyte-benchmarks.md
Last active March 6, 2026 19:58
Acolyte Benchmarks

Acolyte Benchmarks

Measured comparisons of Acolyte against prominent open-source AI coding agents. All metrics are from source code analysis — no opinions, just counts.

Metrics extracted with benchmark.sh

Projects Compared

| Project | Language | Description | Source Lines | Files | Dependencies |

@crisu83
crisu83 / 01-setup.md
Last active February 15, 2026 08:46
Codex Starter Kit

Setting Up Codex

Prerequisites

  • Codex installed
  • Recommended: install Codex via Homebrew for easy updates
  • GitHub CLI authenticated (gh auth login)
  • Copy config.toml to ~/.codex/config.toml

Quick Start

@crisu83
crisu83 / 01-setup.md
Last active February 15, 2026 08:46
Claude Code Starter Kit

Setting Up Claude Code

Prerequisites

Quick Start

@crisu83
crisu83 / 01-openapi.ts
Last active February 16, 2026 06:44
Express + Zod to OpenAPI
import {
OpenAPIRegistry,
OpenApiGeneratorV3,
RouteConfig,
ZodRequestBody,
extendZodWithOpenApi,
} from '@asteasolutions/zod-to-openapi';
import { OpenAPIObjectConfig } from '@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator';
import { Application, NextFunction, Request, RequestHandler, Response, Router } from 'express';
import fs from 'node:fs/promises';
@crisu83
crisu83 / Validator.kt
Last active September 5, 2022 07:22
A validator implementation written in Kotlin.
sealed interface Validator {
fun validate(value: String): Int?
}
object RequiredValidator : Validator {
override fun validate(value: String): Int? =
if (value.isNotBlank()) null else ValidationError.Required
}
object EmailValidator : Validator {
@crisu83
crisu83 / 01-store.kt
Last active February 16, 2026 06:41
A predictable state container (like Redux) written in Kotlin for use with Android view models.
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update
interface State
interface Action
typealias Reducer<State, Action> = (State, Action) -> State
@crisu83
crisu83 / DatePicker.kt
Last active June 28, 2024 16:46
DatePicker and TimePicker components for Jetpack Compose.
@Composable
fun DatePicker(
label: String,
value: String,
onValueChange: (String) -> Unit = {},
keyboardActions: KeyboardActions = KeyboardActions.Default,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
pattern: String = "yyyy-MM-dd",
) {
val formatter = DateTimeFormatter.ofPattern(pattern)
@crisu83
crisu83 / GuessANumber.kt
Last active September 5, 2022 07:25
A "guess a number game" implementation written in Kotlin that we wrote together with my 12 year old son when learning basic concepts in programming.
import kotlin.random.Random
fun main() {
val secretNumber = Random.nextInt(1, 100)
var numTries = 0
var numTriesLeft: Int
var gameWon = false
println("Welcome to Guess a number!")
@crisu83
crisu83 / LoginScreen.kt
Last active October 5, 2021 09:28
LoginScreen
@ExperimentalComposeUiApi
@Composable
fun LoginScreen(
viewModel: LoginViewModel,
navigateToOverview: () -> Unit = {},
onBack: () -> Unit = {},
) {
val uiState by viewModel.uiState.collectAsState()
val (username, setUsername) = viewModel.username
@crisu83
crisu83 / graphql.ts
Created September 4, 2021 09:40
GraphQL API route with remote schema
// See: https://github.com/vercel/next.js/blob/canary/examples/api-routes-apollo-server/pages/api/graphql.js
import {AsyncExecutor} from '@graphql-tools/delegate';
import {introspectSchema, wrapSchema} from '@graphql-tools/wrap';
import {ApolloServer} from 'apollo-server-micro';
import {print} from 'graphql';
import fetch from 'isomorphic-unfetch';
import {NextApiRequest, NextApiResponse} from 'next';
import getConfig from 'next/config';