Skip to content

Instantly share code, notes, and snippets.

@divinity76
divinity76 / RESULTS.md
Last active November 18, 2026 00:44
DeepSeek V4.1 Flash provider speed benchmark: script, task, results

DeepSeek V4.1 Flash provider speed

Same task for every provider: implement is_balanced() with four unit tests, output code only. Streaming, fresh session per request, one warmup plus five measured runs, alternating providers, from one machine. Most rows use each provider's default reasoning settings; Mistral defaults thinking off, so it also has a reasoning_effort: high row.

Fastest observed run is the primary metric; the median includes busier periods. tok/s is the fastest run's rate (reasoning tokens included).

@divinity76
divinity76 / sqlite_rant.txt
Created December 12, 2025 18:21
SQLlite rant
SQLite is kinda shite at handling programmer errors.
If you store music blobs as TEXT or STRING or even just a typo in BLOB,
you will get silent corruption, like missing null bytes.
Be very careful to actually add the datatype `BLOB` to anything containing binary data.
Furthermore, SQLite CLI is a piece of shit when it comes to handling binary data.
I have complained to the SQLite developers about it,
and they just shrug it off as "no can fix, would require massive refactor of the sqlite cli"
look at this shit:
@divinity76
divinity76 / Cloudflare admin token generator.js
Created November 14, 2025 23:50
Cloudflare admin token generator.js
// for use on "Account API Tokens" -> "Create Custom Token",
// https://dash.cloudflare.com/<uid>/api-tokens
function injectJQuery() {
// Avoid double-injecting
if (window.jQuery || document.getElementById("jqueryElement")) return;
let xhr = new XMLHttpRequest();
xhr.open("GET", "https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js", false);
xhr.send();
const script = document.createElement("script");
@divinity76
divinity76 / libcurl_version_scanner.sh
Last active June 3, 2025 13:34
libcurl version scanner bash script
#!/bin/bash
while IFS= read -r -d '' sofile; do
echo "$sofile"
strings "$sofile" | grep -E '[0-9]+\.[0-9]+\.[0-9]+'
done < <(find / -type f -iname "*curl.so*" -print0 2>/dev/null)
@divinity76
divinity76 / functions.sh.php
Created October 6, 2024 22:54
PHP bash glue (run php functions in bash)
#!/usr/bin/php
<?php
// how to include these bash functions in a bash script:
// eval "$(/usr/bin/php /path/to/functions.sh.php)";
declare(strict_types=1);
function quote($str)
{
if (str_contains($str, "\x00")) {
throw new \LogicException("null byte found in string");
}
<?php
declare(strict_types=1);
<<<'EXPLANATION'
We need to process all /home/*/conf/web/*/apache2.conf
replacing sections
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php8.2-fpm-idn-tést.eu.sock|fcgi://localhost"
</FilesMatch>"
with
@divinity76
divinity76 / custom.lua
Last active August 20, 2026 21:10
otclient scripting cheat sheet
function getManaPercent()
return (player:getMana() / player:getMaxMana()) * 100
end
function getHealthPercent()
return (player:getHealth() / player:getMaxHealth()) * 100
end
function hasManashield()
-- return (player:getStates() & (1 << 4)) ~= 0
@divinity76
divinity76 / RectorConfig.php
Last active January 16, 2025 12:23
rector.php example
<?php
declare(strict_types=1);
return (static function (\Rector\Config\RectorConfig $rectorConfig): void {
$rectorConfig->phpVersion(\Rector\ValueObject\PhpVersion::PHP_84);
if (1) {
$timeout = 10 * 60;
$maxNumberOfProcess = (int)shell_exec('nproc');
$jobSize = 10;
$rectorConfig->parallel($timeout, $maxNumberOfProcess, $jobSize);
@divinity76
divinity76 / merge_csv.php
Created March 2, 2024 08:08
csv merger script
<?php
declare(strict_types=1);
function fix_encoding(string $str): string
{
//return $str;
return mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1');
}
@divinity76
divinity76 / bogostress.cpp
Created February 29, 2024 08:06
bogostress.cpp
#define _GNU_SOURCE
#include <iostream>
#include <pthread.h>
#include <chrono>
#include <vector>
#include <unistd.h>
#include <sched.h>
#include <stdexcept>
#include <climits>