Skip to content

Instantly share code, notes, and snippets.

import socket
import dns.resolver
from dns.exception import Timeout, DNSException
def main():
while True:
domain = input("Enter a domain name (example: github.com): ").strip()
if not domain:
print("Please enter a non-empty domain name.")
continue
import sys
import mysql.connector
from mysql.connector import Error
DB_CONFIG = {
"host": "localhost",
"port": 3306,
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
typedef enum {
BROWSING,
TRIAL_STARTED,
PAYMENT_SETUP,
SUBSCRIBED,
CANCELED
#!/usr/bin/env python3
import sys
import subprocess
import platform
import time
import socket
# -----------------------------
# Utility: IP <-> Integer
import pygame
import random
import sys
import math
# ── Constants ──────────────────────────────────────────────────────────────────
CELL = 36 # size of one grid cell in pixels (bigger = bigger snake)
COLS = 50 # number of columns
ROWS = 38 # number of rows
WIDTH = COLS * CELL
// Pin assignments
const int RED_PIN = 13;
const int YELLOW_PIN = 12;
const int GREEN_PIN = 11;
void setup() {
pinMode(RED_PIN, OUTPUT);
pinMode(YELLOW_PIN, OUTPUT);
pinMode(GREEN_PIN, OUTPUT);
#!/usr/bin/env python3
import sys
import mysql.connector
from mysql.connector import Error
# ---------- CONFIGURE THESE FOR YOUR DOCKER MYSQL ----------
DB_CONFIG = {
"host": "localhost",
"port": 3306,
import matplotlib.pyplot as plt
import pandas as pd
# Load CSV
df = pd.read_csv("zombie_outbreak.csv")
# Extract columns
days = df["days"]
zombies = df["total_zombies"]
import pandas as pd
my_collection = {
'player_num': [10, 7, 10, 10, 10, 11, 7],
'first_name': ['Lionel', 'Cristiano', 'Edson', 'Neymar', 'Zlatan', 'Mohamed', 'George'],
'last_name': ['Messi', 'Ronaldo', 'Pele', 'Jr', 'Ibrahimovic', 'Salah', 'Best'],
'Goals': [672, 701, 767, 436, 511, 331, 179],
'Reds': [3, 11, 0, 8, 9, 0, 8],
'Yellows':[85, 129, 2, 97, 94, 18, 35],
'date_joined': ['2004-10-16', '2002-10-07', '1956-09-07', '2009-03-07', '1999-03-31', '2010-05-03', '1963-09-14'],
@ReeceL3
ReeceL3 / GPT 2
Created November 14, 2025 15:04
Interactive story telling
from transformers import pipeline
# Load text generation pipeline
generator = pipeline("text-generation", model="gpt2")
def generate_text(prompt, max_length=120):
result = generator(
prompt,
max_length=max_length,
num_return_sequences=1,