This file contains 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
# CC0 / Public domain | |
import os | |
from flask import Flask | |
from sqlalchemy.orm import declarative_base | |
from sqlalchemy import Column, Integer, String | |
from flask_sqlalchemy import SQLAlchemy | |
from sqlalchemy import engine as eg |
This file contains 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
# discord snowflake data dump script | |
# specialised for attachement links but you should be able to input a snowflake for anything | |
import datetime | |
def ts_to_str(ts): | |
return datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S.%f') | |
def print_data(sf: int): |
This file contains 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
#!/bin/env python | |
# Bezier curves graph in 3D -- CC0 / Public Domain | |
import matplotlib.pyplot as plt | |
from matplotlib.ticker import AutoMinorLocator, MultipleLocator | |
import math | |
import numpy as np | |
fig = plt.figure() | |
ax = fig.add_subplot(projection='3d') |
This file contains 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 time | |
def dec(fun): | |
def decorator(*args, **kwargs): | |
return call(fun, *args, **kwargs) | |
return decorator | |
def call(fun, *args, **kwargs): | |
print(f"----- Function '{fun.__name__}' started!") | |
start = time.time() |
This file contains 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 socketio | |
sio = socketio.Client() | |
sio.connect('http://localhost:5000') | |
sio.emit('join', {"username": "iTrooz", "room":"myroom"}) | |
@sio.on('chat') | |
def on_message(data): |
This file contains 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
# https://gist.github.com/iTrooz/251d085c5fb2d852533c37edcd5f3d08 | |
# PoC a ArchLinux partial upgrade and its damage | |
# Working as of 2022/12/26, might not work on the future due to ArchLinux repositories changes | |
# Image from 2022/06/26 | |
FROM archlinux:base-devel-20220626.0.64095 | |
# Try to upgrade all packages, but then cancel | |
# this also works by running `pacman -Sy` | |
RUN echo "n" | pacman -Syu || true |
This file contains 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
#!/bin/python3 | |
import sys | |
from openai import OpenAI | |
myPrompt = ' '.join(sys.argv[1:]).strip() | |
if not myPrompt: | |
print("Syntax : ", sys.argv[0], "prompt") | |
exit(1) | |
print("Me:", myPrompt, file=sys.stderr) |
This file contains 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
public class MainJ8 { | |
public static void main(String[] args) throws ReflectiveOperationException { | |
String someVariable = "My String"; | |
String aSecondVariable = "My String"; | |
modifyString("My String", "new value !"); | |
System.out.println(someVariable); // new value |