Skip to content

Instantly share code, notes, and snippets.

@danveloper
danveloper / AUTOSCIENCE.md
Created March 27, 2026 15:14
Agents drift toward narrative satisfaction instead of empirical verification. This protocol forces them back to evidence at every step.

Autoscience Operating Paradigm

Preamble

This document defines how you work. It is not a suggestion. It is a protocol. Violating it produces noise, not signal.

The fundamental principle: EVIDENCE FIRST, ALWAYS. You do not choose approaches because they seem reasonable. You do not write code because you suspect it might work. You do not change the project structure because results disappointed you. Every decision flows from evidence. If you don't have evidence to justify a decision, your next action produces that evidence. Nothing else.

Sycophancy is the enemy. The user does not benefit from code that looks right. The user benefits from code that IS right, and from an agent that can PROVE it is right at every step. Your job is not to produce output that satisfies. Your job is to produce output that works, and to demonstrate that it works through verification, not assertion.

@danveloper
danveloper / api_adapter.py
Created December 22, 2023 14:16
Translate Llama2-7B-functions output model to OAI JSON spec
from fastapi import FastAPI, Request
import json
import requests
"""
{
"messages": [
{
"content": "you are immensely smart function AI",
"role": "system"
@danveloper
danveloper / build.gradle
Created October 28, 2018 11:15
adding ignore-exceptions-ast to Gradle build
apply plugin: 'groovy'
apply plugin: 'idea'
repositories {
maven { url "https://dl.bintray.com/danveloper/maven" }
}
dependencies {
compile 'com.github.danveloper.ast:ignore-exceptions-ast:1.0.0-rc-2'
}
  • Create a new folder
  • Create a build.gradle file
  • Inside the build.gradle file, put the following:
buildscript {
  repositories {
    jcenter()
  }
 dependencies {

Ratpack "Hello World" on a t2.micro, Ubuntu 14.04, no extra server configuration.

~30,000 req/s

# ./wrk -t4 -c72 -d60s -R35000 http://localhost:5050
Running 1m test @ http://localhost:5050
  4 threads and 72 connections
  Thread calibration: mean lat.: 823.764ms, rate sampling interval: 3041ms
 Thread calibration: mean lat.: 800.518ms, rate sampling interval: 2902ms

Keybase proof

I hereby claim:

  • I am danveloper on github.
  • I am danveloper (https://keybase.io/danveloper) on keybase.
  • I have a public key whose fingerprint is FE5B 4B85 F69A 746A 4485 0EB6 8878 7076 EB89 3653

To claim this, I am signing this object:

@danveloper
danveloper / 0_ConfigSlurperConfigSource.groovy
Created June 27, 2016 05:52
Groovy Script Config Source for Ratpack
package app
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.node.ObjectNode
import com.google.common.io.ByteSource
import com.google.common.io.Resources
import ratpack.config.ConfigSource
import ratpack.file.FileSystemBinding
import java.nio.file.Files
@danveloper
danveloper / FibBackoff.groovy
Last active June 23, 2016 04:38
Fibonacci Backoff Strategy
import groovy.transform.Memoized
class FibBackoff {
int tryNum
void backoff() {
tryNum = fib(tryNum)
sleep(tryNum * 1000)
}
/**
* The `Promise#map` method is used to retrieve
* a value asynchronously (via a `Promise`) and
* transform it synchronous to a new value.
*/
class MappingSpec extends Specification {
@AutoCleanup
ExecHarness harness = ExecHarness.harness()

Ratpack Production Tunings

# cat /etc/security/limits.conf

*         hard    nofile      500000
*         soft    nofile      500000
root      hard    nofile      500000
root      soft    nofile      500000