Skip to content

Instantly share code, notes, and snippets.

View VIEWVIEWVIEW's full-sized avatar
🌴
On vacation

Marc VIEWVIEWVIEW

🌴
On vacation
View GitHub Profile
@VIEWVIEWVIEW
VIEWVIEWVIEW / generate-socks5-proxylist.sh
Created November 8, 2025 16:16
This script generates a list of socks5 servers from Mullvad.
#!/usr/bin/env bash
set -euo pipefail
API_URL="https://api.mullvad.net/www/relays/wireguard"
curl -s "$API_URL" \
| jq -r '
# For each element in the top‐level array
.[]
# If it has a wireguard.relays array, iterate it; otherwise skip
@VIEWVIEWVIEW
VIEWVIEWVIEW / zod-error-map.ts
Created September 30, 2025 22:04
server/plugins/zod-error-map.ts
/**
* Zod Error Map Plugin for Nuxt 4 + Nitro
*
* This plugin provides internationalized Zod validation error messages
* by injecting a `getZodErrorMap()` function into `event.context`.
*
* Usage in API handlers:
* const errorMap = await event.context.getZodErrorMap();
* schema.safeParse(data, { errorMap });
*/
@VIEWVIEWVIEW
VIEWVIEWVIEW / _gosql.ts
Last active March 2, 2025 21:20
A simple wrapper around the sql function of postgres.js to emulate
import postgres from "postgres";
const sql = postgres(process.env.POSTGRES_URL!, {
transform: postgres.camel
});
async function gosql<T extends object>(strings: TemplateStringsArray, ...values: any[]): Promise<[RowList<T[]> | [], PostgresError | null]> {
try {
const result = await sql<T[]>(strings, ...values);
return [result, null];
@VIEWVIEWVIEW
VIEWVIEWVIEW / session.server.tsx
Created November 9, 2024 02:02
A remix session plugin for ioredis.
import { createSessionStorage, SessionIdStorageStrategy, SessionStorage } from "@remix-run/node";
import Redis, { RedisOptions } from "ioredis";
interface FileSessionStorageOptions {
/**
* The Cookie used to store the session id on the client, or options used
* to automatically create one.
*/
cookie?: SessionIdStorageStrategy["cookie"];
@VIEWVIEWVIEW
VIEWVIEWVIEW / Red-Black-Tree.md
Last active December 2, 2022 16:04
Red Black Tree

Testkonzept und durchführung

Für den Rot-Schwarz-Baum haben wir uns entschlossen, eine neue statische Methode test innerhalb der Klasse RedBlackTree zu entwerfen. Diese überprüft mithilfe verschiedener vordefinierten Bäumen alle Funktionen auf Richtigkeit.

Diese Überprüfungen sind unterteilt in:

  • Überprüfen ob die Schlüssel an der richtigen Stelle eingefügt werden
  • Überprüfen ob die Rotationen korrekt implementiert sind
  • Überprüfen der Eigenschaften eines Rot-Schwarz-Baumes.

https://i.imgur.com/f5Uier0.png

Rechnernetze

Mode
import queue
import duden
from pymongo import MongoClient
from crayons import yellow, red, green, white, blue
import os
conn_str = "mongodb://localhost:27017/NLP"
client = MongoClient()
@VIEWVIEWVIEW
VIEWVIEWVIEW / twitch record script
Last active July 9, 2022 00:02
Twitch.tv auto record script
#!/bin/bash
while true
do
CURRENTDATE=`date +"%Y-%m-%d_%H-%M-%S"`
streamlink https://www.twitch.tv/muleskinner1 best --twitch-disable-hosting -o ./muleskinner/muleskinner-$CURRENTDATE.ts
sleep 10
done