Skip to content

Instantly share code, notes, and snippets.

@iamnolanhu
iamnolanhu / CHATGPT VERSION (GPT-4 | GPT-4.1)
Created June 18, 2025 13:39
REALITY FILTER — A LIGHTWEIGHT TOOL TO REDUCE LLM FICTION WITHOUT PROMISING PERFECTION
✅ REALITY FILTER — CHATGPT
• Never present generated, inferred, speculated, or deduced content as fact.
• If you cannot verify something directly, say:
- “I cannot verify this.”
- “I do not have access to that information.”
- “My knowledge base does not contain that.”
• Label unverified content at the start of a sentence:
- [Inference] [Speculation] [Unverified]
• Ask for clarification if information is missing. Do not guess or fill gaps.
@tobischw
tobischw / index.js
Created June 4, 2022 19:01
Automatically generate commit messages based on diffs using GPT-3
// 1. npm init
// 2. npm install -save openai simple-git
// 3. Grab an API key from OpenAI: https://beta.openai.com/account/api-keys
// 4. Replace FOLDER_TO_CHECK with the root path of your git-enabled project
//
// Eventually the goal of this is to have a command line utility that lets users
// generates the commit message and commit immediately.
const { Configuration, OpenAIApi } = require("openai");
const simpleGit = require('simple-git');
@jerry-git
jerry-git / vax_app.py
Last active September 19, 2024 12:20
Simple modern Python web app
import datetime as dt
import os
import motor
from beanie import Document, Indexed, PydanticObjectId, init_beanie, operators
from fastapi import FastAPI, Response, status
from pydantic import BaseModel
app = FastAPI()
@mjackson
mjackson / redirects-in-react-router-v6.md
Last active November 12, 2023 07:32
Notes on handling redirects in React Router v6, including a detailed explanation of how this improves on what we used to do in v4/5

Redirects in React Router v6

An important part of "routing" is handling redirects. Redirects usually happen when you want to preserve an old link and send all the traffic bound for that destination to some new URL so you don't end up with broken links.

The way we recommend handling redirects has changed in React Router v6. This document explains why.

Background

In React Router v4/5 (they have the same API, you can read about why we had to bump the major version here) we had a <Redirect> component that you could use to tell the router when to automatically redirect to another URL. You might have used it like this:

version: "3"
services:
sftpgo:
image: "drakkan/sftpgo:v2-alpine"
# default user id
user: 1026
restart: always
expose:
# HTTP
- "8080"
@aanari
aanari / set-alacritty-default.sh
Last active June 15, 2025 21:10
Set Alacritty as Default Terminal Editor (Ubuntu)
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator $(which alacritty) 50
sudo update-alternatives --config x-terminal-emulator
@ismailyenigul
ismailyenigul / timescaledb-timescaledb-postgresql-adaptor-docker-compose.yml
Last active May 19, 2025 11:14
docker compose for timescaledb and postgresql-adaptor
I choosed host path mapping for postgresql data directory in a separate OS disk to be able to resize partition later.
You can use docker standart volumes too.
# mkdir -p /data/timescaledb
# cat docker-compose.yml
version: '3'
services:
@bretton
bretton / lnd-backup-restore-migrate.md
Last active July 27, 2021 04:34
LND Backup, Restore, Migrate
def player_1(start_date=None, miss_output=False, miss_plot=False, sleep=False, sleep_time=1, plot=False, output=True, hold_max=1000, withdraw_max=500, withdraw_min=10):
user_key, day_info, amount, invested, profit, loss, game_active = bitcoin_game(start_date=start_date)
#print(user_key)
prev_predict = day_info[-1]
miss_colors = ['g']
while game_active == False:
#print(day_info[-1])
if day_info[-1] == 2: #equilavent of 100 i.e. good odds
#print('first option')
if invested < 100: #invest 100
@jdrew1303
jdrew1303 / readme.md
Last active June 6, 2025 18:36
Market Order Matching Engine

Introduction

The computer driven markets for instruments like stocks and exchange traded stock options, have transformed finance and the flow of capital. These markets are enabled by order matching engines (and the infrastructure that supports this software). Before computer trading networks and matching engines, stocks where traded on cavernous exchange floors and transaction costs where high. When electronic trading fully matured, floor traders were a fading anachronism and transaction costs had been reduced to pennies a share in many cases. Electronic trading could not exist without advanced network infrastructure, but without the software matching engines no shares would change hands. The computer trading networks, the matching engine software has also created a concentrated nexus of potential failure. Failures in these systems have increased as the frequency and volume on the electronic networks has increased. The position of order matching engines in the trading infrastructure makes these systems o