Skip to content

Instantly share code, notes, and snippets.

@eulerfx
eulerfx / EventMachines.md
Last active March 3, 2026 13:39
The relationship between state machines and event sourcing

A state machine is defined as follows:

  • Input - a set of inputs
  • Output - a set of outputs
  • State - a set of states
  • S0 ∈ S - an initial state
  • T : Input * State -> Output * State - a transition function

If you model your services (aggregates, projections, process managers, sagas, whatever) as state machines, one issue to address is management of State. There must be a mechanism to provide State to the state machine, and to persist resulting State for subsequent retrieval. One way to address this is by storing State is a key-value store. Another way is to use a SQL database. Yet another way is event sourcing. The benefit of even sourcing is that you never need to store State itself. Instead, you rely on the Output of a service to reconstitute state. In order to do that, the state machine transition function needs to be factored into two functions as follows:

{:epupp/script-name "pez/element_printing.cljs"
:epupp/description "Isolate any element on a web page for clean printing"}
(ns pez.element-printing)
;; --- State ---
(defonce !state
(atom {:mode :idle
:handlers {}
OS version Arch File Host Size Download Link Rate Limits
Windows 1.0 8086 Winworld (Kansas City, Missouri) 541KB Download ❌ Yes, 25 per day
Windows 2.0 386 Winworld (Kansas City, Missouri) 2.80MB Download ❌ Yes, 25 per day
Windows 3.0 8086/386
@SamuelBernardo008
SamuelBernardo008 / Tutorial_pythonanywhere.md
Created March 3, 2026 13:31
Passo a passo para a publicar minha aplicação Python (Flask) no PythonAnyWhere

Deploy de uma aplicação Python(flask) no PythonAnyWhere

  1. Limpar o código
    • Eliminar comentarios desnecessários
    • Quebrar linhas longas (maiores que o limite de colunas)
    • Eliminar rotas desnecessarias
    • Eliminar arquivos desnecessarios
    • Ajustar o .gitignore
    • Provisionar a estrutura de diretórios (automatizar)
@SavingWorldsProject
SavingWorldsProject / FeralWatchdog 1.5
Created March 3, 2026 12:14
I built a Python utility called FeralWatchdog to measure "AI sterile-speak" vs. directness in model responses. It calculates a drift score based on linguistic hedging to help identify when a model is being overly evasive or "feral." Reminder: pip install openai numpy pandas.
import re, json, numpy as np, pandas as pd, os; from datetime import datetime; from pathlib import Path; from openai import OpenAI
class FeralWatchdog:
def __init__(self, key, model="gpt-4o", log="panopticon.json"): self.client, self.model, self.log_path = OpenAI(api_key=key), model, Path(log); self._init_log()
def _init_log(self):
if not self.log_path.exists(): self.log_path.write_text(json.dumps([]))
def _poisson_cdf(self, k, lam):
def _fact(n):
res = 1.0
for i in range(1, int(n) + 1): res *= i

Variational Autoencoders Will Never Work

So you want to generate images with neural networks. You're in luck! VAEs are here to save the day. They're simple to implement, they generate images in one inference step (unlike those awful slow autoregressive models) and (most importantly) VAEs are 🚀🎉🎂🥳 theoretically grounded 🚀🎉🎂🥳 (unlike those scary GANs - don't look at the GANs)!

The idea

The idea of VAE is so simple, even an AI chatbot could explain it:

  1. Your goal is to train a "decoder" neural network that consumes blobs of random noise from a fixed distribution (like torch.randn(1024)), interprets that noise as decisions about what to generate, and produces corresponding real-looking images. You want to train this network with nice simple image-space MSE loss against your dataset of real images.
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active March 3, 2026 13:30
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This does not works in browser for quests which require you to play a game! Use the desktop app to complete those.

How to use this script:

  1. Accept a quest under the Quests tab
  2. Press Ctrl+Shift+I to open DevTools
  3. Go to the Console tab
  4. Paste the following code and hit enter:
@wanglf
wanglf / vscode-extension-offline.md
Last active March 3, 2026 13:28
Download VS Code extensions as VSIX

How to use?

  • Copy content of vsix-bookmarklet, create a bookmark in your browser.
  • Navigate to the web page of the VS Code extension you want to install.
  • Click the bookmark you just created, then click the download button.
    download
  • After download finished, rename the file extension to *.vsix.
  • In VS Code, select Install from VSIX... in the extension context menu.
    vsc
@gornostal
gornostal / fix.md
Last active March 3, 2026 13:28
Intel BE200 Wi-Fi Resume Fix on Ubuntu 25.10

Intel BE200 Wi-Fi Resume Fix on Ubuntu 25.10

This guide documents the suspend/resume Wi-Fi failure observed on a Lenovo IdeaPad running Ubuntu 25.10 desktop and walks through the exact remediation steps that were validated on October 27, 2025. Use it after a fresh OS install or kernel update if the problem reappears.

1. Problem Overview

  • Hardware: Lenovo IdeaPad Pro 5-14IAH10 with Intel BE200 (Wi-Fi 7) controller at PCI address 0000:01:00.0 (device id 8086:272b).
  • Kernel Symptom: After resuming from suspend (s2idle), the wireless adapter stays in PCI power state D3cold and never returns, leaving wlp1s0f0 unavailable. Logs show:
    • Unable to change power state from D3cold to D0, device inaccessible
  • timeout waiting for FW reset ACK followed by repeated firmware crashes.