Skip to content

Instantly share code, notes, and snippets.

View mentix02's full-sized avatar
💻
coding away

Manan mentix02

💻
coding away
View GitHub Profile
@mentix02
mentix02 / context.ts
Last active June 28, 2025 10:10
Auth
import z from "zod";
import { createContext } from "react";
export const AuthDataSchema = z
.object({
id: z.string().optional(),
name: z.string().optional(),
email: z.string().email().optional(),
token: z.string().optional(),
@mentix02
mentix02 / client.py
Created March 15, 2025 20:36
A comparision between aiohttp, requests, and httpx in Python
import sys
import time
import random
import asyncio
import argparse
from typing import Callable, Coroutine
import httpx
import aiohttp
import requests
@mentix02
mentix02 / dumpm.py
Last active November 19, 2024 16:00
A crazy command to dump the specified model's serialized (also specified) data to the console.
"""
Author: mentix02
Date: 2024-10-09
A crazy command to dump the specified model's serialized (also specified) data to the console.
"""
import json
import typing
import argparse
@mentix02
mentix02 / conv.c
Last active November 3, 2024 12:35
Simple conversion lib
#include "conv.h"
#include <string.h>
uint64_t toUint64T(const char * nstr) {
uint8_t digit;
uint64_t res = 0;
for (size_t i = 0; i < strlen(nstr); ++i) {
digit = nstr[i] - '0';
res = res * 10 + digit;
@mentix02
mentix02 / black-django.py
Created January 25, 2024 11:58
Some dangerous code
"""
This code contains some extreme levels of black magical Python code with abstractions that
your tiny brain just might not be able to comprehend. Read on if you dare to - otherwise
leave this file and never return. Consider yourself warned.
- mentix02, 2024-01-18
"""
from typing import Callable
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route("/")
def home():
return render_template("index.html")
#!/usr/bin/env python3
import enum
import time
import random
import argparse
@enum.unique
class Tile(enum.Enum):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mentix02
mentix02 / internet-check.cpp
Created December 15, 2022 04:25
Internet checker
#include <array>
#include <regex>
#include <chrono>
#include <thread>
#include <string>
#include <cstdio>
#include <memory>
#include <cstdint>
#include <iostream>
#include <stdexcept>