Skip to content

Instantly share code, notes, and snippets.

View nilsreichardt's full-sized avatar
🔥
Focusing

Nils Reichardt nilsreichardt

🔥
Focusing
View GitHub Profile
@nilsreichardt
nilsreichardt / keybindings.json
Created April 22, 2026 12:41
Open Keyboard Shortcuts
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "alt+f",
"command": "rewrap.rewrapComment",
"when": "editorTextFocus"
},
{
"key": "alt+q",
"command": "-rewrap.rewrapComment",
@nilsreichardt
nilsreichardt / predict_random.dart
Created March 25, 2026 20:06
Proof of concept to predict next values if you use Random() instead of Random.secure() in Dart.
// Generated with Gemini 3 Flash
//
// Usage: dart run predict_random.dart
import 'dart:math';
void main() {
final random = Random();
final A = 0xFFFFDA61;
final MASK_32 = 0xFFFFFFFF;
@nilsreichardt
nilsreichardt / Strava Challenge Prompt for Poke
Created October 10, 2025 06:31
strava_prompt_for_poke.md
I want to set myself a challenge: to do some sport every day. You have to supervise me and check that I’m actually doing it.
Please create the following service: check my Strava every day at 3 p.m. (using MCP) and verify whether I’ve uploaded an activity.
If I haven’t, insult me as much as you can — be brutal! That’s one of your strengths, so use it.
Then check again at 9 p.m.; if there’s still no Strava activity, insult me even more.
@nilsreichardt
nilsreichardt / sum_openai_usage_tokens.py
Created October 7, 2025 17:34
This Python script scans all CSV files in a folder, sums up `input_tokens` and `output_tokens` from each file, reports per-file totals, and prints the grand total across all files.
#!/usr/bin/env python3
"""
Sum OpenAI usage tokens from CSV exports.
For each *.csv file in the provided folder, this script computes:
- SUM(input_tokens)
- SUM(output_tokens)
- SUM(input_tokens + output_tokens)
Then it prints a per-file summary and a final total across all files.
@nilsreichardt
nilsreichardt / make_passport_sheet.py
Created July 11, 2025 09:59
US Passport Image to German Passport Image
#!/usr/bin/env python3
"""
make_passport_sheet.py
Create a 10 × 15 cm print sheet containing six German-passport-size photos
(35 mm × 45 mm) from a square 2 × 2-inch source image.
Usage:
python make_passport_sheet.py input.jpg output.jpg --dpi 300
"""
@nilsreichardt
nilsreichardt / sw_hard_bounce.py
Created June 6, 2024 19:48
Get all email addresses rejected due to hard bounce. For Scaleway transaction emails
import requests
import json
def fetch_emails(auth_token, output_file):
base_url = 'https://api.scaleway.com/transactional-email/v1alpha1/regions/fr-par/emails'
params = {'flags': 'hard_bounce', 'page': 0}
headers = {'X-Auth-Token': auth_token}
all_emails = []
while True:
@nilsreichardt
nilsreichardt / codemagic.yaml
Created May 6, 2023 17:08
The codemagic.yaml of the Flutter Counter app file for M2 vs M1 vs Mac Pro comparison
definitions:
environment_setup: &environment_setup
flutter: v3.7.12
xcode: 14.3
scripts:
- &install_dependencies
name: Install dependencies
script: flutter pub get
- &build_ipa
name: Build IPA
@nilsreichardt
nilsreichardt / codemagic.yaml
Created May 6, 2023 17:07
The codemagic.yaml of the Sharezone app file for M2 vs M1 vs Mac Pro comparison
definitions:
environment_setup: &environment_setup
flutter: v3.7.12
xcode: 14.3
groups:
- ios-publishing
- certificate_credentials
scripts:
- &install_dependencies
name: Install dependencies
@nilsreichardt
nilsreichardt / ControlFlowGraphPrompt.md
Last active July 10, 2025 10:15
A prompt to convert text into a Mermaid control flow graph

Prompt

Please convert the following text into a Mermaid diagram like a control flow graph. The "Jump to" commands should not be translated 1:1. Instead, you should use the connections arrows (-->). Do not name the numbers in the diagram. Convert double quotes to single quotes. Decisions are using {} instead of []. Use meaningful graph IDs instead of (1,2,3 or A, B, C).

  1. Is PR a fork? If yes, jump to 2, if no, jump to 3
  2. Remove the "safe to build" label, jump to 3
  3. Execute the "changes" workflow, jump to 4
  4. Is PR a fork? If yes, jump to 5, if no, jump to 7
  5. Has PR "safe to build label"? If yes, jump to 7, if no, jump to 6.
  6. Cancel
@nilsreichardt
nilsreichardt / release_app.sh
Created July 29, 2022 17:44
A script to bump the app version, deploy the app to App Store Connect and Firebase Distribution and create a GitHub release with a changelog.
#!/bin/bash
# Script to deploy a new app update to the alpha environment manually.
#
# This script is not used by CI. It's meant to be run manually to avoid high CI
# build times.
#
# When the compnay has more money, we should only deploy to the alpha track via
# CI and delete this script.