This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
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.
- Download the
audio-device-switch.shscript and place it in/usr/local/bin. - Make the script executable:
sudo chmod 755 /usr/local/bin/audio-device-switch.sh. - Open the Keyboard Shortcuts settings page, add a new shortcut, tell it to execute
audio-device-switch.sh, and set up your shortcut! - Install the
notify-sendlibrary if you want to see a popup notification when the audio device switches:sudo apt install libnotify-bin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)) { |
NewerOlder