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
type WebhookEventAttributes = { | |
http_request: { | |
client_ip: string; | |
user_agent: string; | |
}; | |
}; | |
type Webhook<EvtType, Data> = { | |
type: EvtType; | |
object: 'event'; |
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
class Klass: | |
@property | |
def value_a(self) -> bool: | |
print('Value a accessed') | |
return False | |
@property | |
def value_b(self) -> bool: | |
print('Value b accessed') | |
return False |
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 python3 | |
""" | |
File: earth911.py | |
Author: mentix02 (Manan manan.yadav02@gmail.com) | |
Task: Scrape search results of search.earch911.com and extract data into a CSV file. | |
Making a request to search.earth911.com by spoofing the headers to make it look like you're coming from a | |
browser. We are returned with plain HTML - no JSON API to reverse engineer unfortunately. Parsing this HTML, | |
we get a list of hrefs over which we loop (asynchronously, of course) and fetch details of the individual | |
centre (in HTML - from which we extract a dictionary of properties). |
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
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(), |
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
import sys | |
import time | |
import random | |
import asyncio | |
import argparse | |
from typing import Callable, Coroutine | |
import httpx | |
import aiohttp | |
import requests |
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
""" | |
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 |
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
#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; |
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 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 |
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
from flask import Flask, render_template, request, jsonify | |
app = Flask(__name__) | |
@app.route("/") | |
def home(): | |
return render_template("index.html") |
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 python3 | |
import enum | |
import time | |
import random | |
import argparse | |
@enum.unique | |
class Tile(enum.Enum): |
NewerOlder