Skip to content

Instantly share code, notes, and snippets.

"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
# remotes::install_github("walkerke/mapgl")
library(mapgl)
# CYBERPUNK 2125 - Ultra-striking neon palette
# Deep blacks + electric neons for that Blade Runner / Akira vibe
cyberpunk_2125 <- c(
"#000000", # Pure black (shadows)
"#0a0e27", # Deep space blue (dark areas)
"#1a1a2e", # Dark navy (buildings)
"#16213e", # Midnight blue
// Simulation parameters
const ACCOUNTS_TARGET: usize = 20_000;
const INSTRUMENTS_TARGET: usize = 15;
// number of events to stdout before the final line
const TICKS_GENERATED_COUNT: u64 = 1_000_000 - 1;
// Trading constraints
const TRADE_MAX_SZ: u64 = 1_000;
const TRADE_MAX_PX: u64 = 1_000_000;
const TRADE_MIN_PX: u64 = 100;
@databento-bot
databento-bot / scanner.py
Last active February 26, 2026 10:29
Real-time scanner for detecting large price movements in all US stocks and ETFs
"""
This script demonstrates how to build a real-time scanner that detects significant
price movements across all US stocks and ETFs using Databento's market data APIs.
Features:
- Handles entire US equities universe of ~9,000 symbols efficiently
- Median sub-ms feed delay to NY4/5 (WAN-shaped) and ~5s to start scanning
- Monitors all US stocks and ETFs for price movements exceeding a configurable threshold
- Compares current prices against previous day's closing prices
- Displays alerts when significant moves are detected
#!/usr/bin/env python
# Building high-frequency trading signals in Python with Databento and sklearn
#
# This is a simple example that demonstrates how to build high-frequency trading signals in Python,
# using order book and market depth data from [Databento](https://databento.com) together with
# machine learning models from [sklearn](https://scikit-learn.org/).
import databento as db
import numpy as np
@underscoDe
underscoDe / LeetcodeBlind75.md
Last active March 2, 2026 01:26
Customized LeetCode study plans. Grind all 169 questions. This is a gist to help you track your progress.

Grind 169 Leetcode questions

An updated version of Blind 75

Filters:

  • View All Questions
  • Order by Difficulty
  • Group by Topics

Array

@pgillet
pgillet / README.md
Last active March 17, 2025 00:42 — forked from kbravh/README.md
Switch audio output devices on Linux

Audio Output Switcher

This script will cycle to the next available audio output device. It can be tied to a hotkey to easily be triggered. This is handy, for example, for swapping between HDMI audio and headphones.

Install

  1. Download the audio-device-switch.sh script and place it in /usr/local/bin.
  2. Make the script executable: sudo chmod 755 /usr/local/bin/audio-device-switch.sh.
  3. Open the Keyboard Shortcuts settings page, add a new shortcut, tell it to execute audio-device-switch.sh, and set up your shortcut!
  4. Install the notify-send library if you want to see a popup notification when the audio device switches: sudo apt install libnotify-bin.

Customizations

@tylermorganwall
tylermorganwall / submarine_cable_map.R
Last active January 1, 2026 13:29
Submarine Cable Map Dataviz
library(geojsonsf)
library(sf)
library(rayrender)
#Data source: https://github.com/telegeography/www.submarinecablemap.com
cables = geojson_sf("cable-geo.json")
cablescene = list()
counter = 1
for(i in 1:length(cables$geometry)) {