Skip to content

Instantly share code, notes, and snippets.

@ustun
ustun / google_genie_prompt_hagia_sophia_550_AD.md
Created November 20, 2026 11:04
Google Genie Prompt Byzantine Constantinople around 550 AD

First-person egocentric walking perspective in Byzantine Constantinople around 550 AD, during the reign of Emperor Justinian I, in late afternoon sunlight.

Spatial layout: You are walking along the edge of the sandy track inside the massive, U-shaped Hippodrome of Constantinople, looking northeast toward the newly completed Hagia Sophia. Running down the center of the arena is the raised marble Spina (central barrier), lined with the Egyptian Obelisk of Theodosius, the intact bronze Serpent Column with all three serpent heads gleaming, and a towering masonry obelisk clad in shimmering gilded bronze plates. Rising steeply on both sides are monumental tiers of white marble stadium seating crowned by colonnaded walkways and bronze statues. On the right (east) side, the ornate marble Imperial Box (the Kathisma) rises above the stands, draped in Tyrian purple silk banners and connected to the tiled roofs of the Great Palace. Ahead beyond the northern colonnade of the stadium, the colossal, freshly built Hagia Sop

@ustun
ustun / fix_scale.md
Last active March 31, 2026 08:02
Set display scale to 200% from command line in latest Ubuntu (Wayland)

fix_scale.py

A small Python script to set display scaling on GNOME/Mutter via D-Bus — no GUI needed.

Why

If you run Ubuntu in a VM (particularly UTM/QEMU on macOS), spice-vdagent likes to reset your display scaling whenever the resolution changes — e.g. when you resize the VM window. This script sets it back to 200% from the command line by calling Mutter's DisplayConfig D-Bus API directly, the same API that GNOME Settings uses.

Usage

@ustun
ustun / load-env.ts
Created March 25, 2026 10:49
Loading dotenvx encrypted local secrets with Decryption Key Stored in Keychain: https://dev.to/ustun/a-small-hardening-trick-for-envlocal-dotenvx-os-keychain-2533
import { execFileSync } from "node:child_process";
import { existsSync } from "node:fs";
import { resolve } from "node:path";
import { config } from "@dotenvx/dotenvx";
export function loadEnv(): void {
for (const file of [".env", ".env.local"]) {
const path = resolve(process.cwd(), file);
if (existsSync(path)) {
config({ path });
#!/usr/bin/env bash
set -euo pipefail
ROOT="${HOME}"
PATTERN="token|api|key"
usage() {
cat <<'EOF'
Scan for env files under a root directory that contain sensitive-looking patterns.
@ustun
ustun / azure_devops_update_build_number.sh
Last active June 5, 2020 09:48
Azure Devops Set Build Number for Master & PRs
#!/bin/bash
# Script to set build number in Azure Devops
# We want build number of the following form:
# "build master efab0 20190505 12:12"
# "build pr feature/foo efab0 20190505 12:12"
# Builtin Azure Devops build numbering is insufficient, so we override with this script.
(require 'ht)
(setq log-this-js-log-format "console.log('%s: ', %s)")
(setq log-this-python-log-format "print(\"%s: \", %s)")
(setq log-this-clojure-log-format "(print \"%s: \" %s)")
(setq log-this-log-formats
(ht ("typescript-mode" log-this-js-log-format)
("js2-mode" log-this-js-log-format)
("js-mode" log-this-js-log-format)
PATH mevzusu cogu programci icin tam anlasilmayan ve her programlama dilinde farkli cozulen bir sorun
ve cok vakit kaybina neden oluyor
peki virtualenv ne demek ona deginelim, aslinda virtualenv'in yaptigi su. Senin PATH'inin basina virtualenv klasorundeki bin klasorunu koyuyor
yaptigi temelde bu
virtualenv calistirmadan once PATH=/usr/bin:/bin diyelim
bu durumda ahmet yazarsan ahmet binary'sini o klasorlerde arayacak
virtualenv'i aktive ettiginde yaptigi aslinda su
PATH=myenv/bin;/usr/bin:/bin
dolayisiyla virtualenv cok da bir sey yapmiyor
virtualenv'i aktiflestirmeden dogrudan o venv icindeki python'u da calistirirsan ayni kapiya cikar
import logging
import logging.config
def configure_logging():
LOG_DIR = "logs/"
LOGGING = {
"version": 1,
"disable_existing_loggers": True,
@ustun
ustun / slim-redux.js
Created April 11, 2017 09:33 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
<h1>On Yılda Programlama Öğrenin <sup><a href="#footnote1">(*)</a></sup></h1>
<h3>Peter Norvig <sup><a href="#footnote2">(**)</a></sup></h3>
<hr>
<h2>Neden herkes böyle bir telaş içinde?</h2>
Herhangi bir kitapçıya gittiğinizde Teach Yourself Java in 7 Days (7 Günde Java Öğrenin) benzeri,
size birkaç günde veya birkaç saatte Visual Basic, Windows, Internet (vs.) öğretmeyi vadeden