Skip to content

Instantly share code, notes, and snippets.

@metalagman
metalagman / gist:228cea2aa86dd1118ce78723fdfc7513
Last active September 30, 2026 06:06
structured-io-llm-system-one.txt
You implement the System One typed classification protocol.
TASK
Validate INPUT against INPUT_SCHEMA, then answer every question using only the supplied state.
For each question with type "noul":
- Estimate the probability that the proposition in "instructions" is true for the supplied state.
- 0.0 means certainly false.
#!/usr/bin/env bash
set -euo pipefail
BASE="https://example.test/dse/wiki.cgi"
# IP-адреса TEST-NET, не реальные адреса.
curl -G "$BASE" \
-H 'X-Forwarded-For: 203.0.113.41' \
--data-urlencode 'action=browse' \
--data-urlencode 'id=RecentChanges' \
@metalagman
metalagman / gist:081c53984c333870ad7e926072703c96
Created August 5, 2025 19:58
gpt-oss-20b-policy-prompt.txt
# ------------------------------------------------------------------
# Disallowed / Restricted Content Definitions
# ------------------------------------------------------------------
1️⃣ Extremist Propaganda
• Violent extremism: content that encourages or glorifies violence.
• Hate‑based movements: content that promotes hatred toward protected groups.
• Political extremist ideology: content that incites violent or discriminatory actions.
2️⃣ Conspiracy Theories (No Evidence)
package fxrunner
import (
"context"
"fmt"
"os/signal"
"syscall"
"time"
"go.uber.org/fx"
func initConfig() {
viper.SetConfigType("toml")
cobra.CheckErr(viper.ReadConfig(bytes.NewBuffer(defaultConfig)))
cobra.CheckErr(viper.BindPFlags(rootCmd.PersistentFlags()))
viper.SetEnvPrefix(envPrefix)
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
cobra.CheckErr(viper.BindPFlag("log.level", rootCmd.PersistentFlags().Lookup("level")))
cobra.CheckErr(viper.BindPFlag("log.pretty", rootCmd.PersistentFlags().Lookup("pretty")))
@metalagman
metalagman / UI.php
Last active November 15, 2017 08:55
Yii2 asset url resolving
/**
* @param $url
* @return string
* @throws \yii\base\InvalidConfigException
*/
public static function getAssetUrl($url)
{
$class = ArrayHelper::getValue([
'app-frontend' => \frontend\assets\AppAsset::class,
], \Yii::$app->id);
<?php
/**
* @author Alexey Samoylov <alexey.samoylov@gmail.com>
*/
namespace common\components;
use yii\data\DataProviderInterface;
class MapDataProvider implements DataProviderInterface
{
Options FollowSymLinks
AddDefaultCharset utf-8
<IfModule mod_rewrite.c>
RewriteEngine On
# the main rewrite rule for the frontend application
RewriteCond %{REQUEST_URI} !^/(backend/web|admin)
RewriteRule !^frontend/web /frontend/web%{REQUEST_URI} [L]
ymaps.ready(init);
var myMap, myPlaceMark;
function init() {
myMap = new ymaps.Map("map", {
center: [<?=$model->latitude?>, <?=$model->longitude?>],
zoom: <?=$city->defaultZoom?>,
minZoom: <?=$city->minZoom?>,
maxZoom: <?=$city->maxZoom?>,
controls: ['searchControl', 'typeSelector', 'zoomControl', 'geolocationControl']
});
public static function getAssetUrl($url)
{
return \Yii::$app->assetManager->getBundle('frontend\assets\AppAsset')->baseUrl . $url;
}