Skip to content

Instantly share code, notes, and snippets.

@mewmix
mewmix / directc.py
Last active January 15, 2024 05:26
Celsius & Farenheit Alignment
from sympy import symbols, Eq, solve
# Solving the equation C = (9/5)C + 32 directly
C = symbols('C')
# Rearrange the equation to solve for C
direct_equation = Eq(C, (9/5)*C + 32)
# Solve the equation
direct_solution = solve(direct_equation, C)
@mewmix
mewmix / bot.py
Last active September 30, 2023 02:40
python-telegram-bot-13.6-join-bot
from telegram import Bot, Update
from telegram.ext import Updater, MessageHandler, Filters, CommandHandler, CallbackContext
import os
import json
BOT_TOKEN = ''
CHAT_GROUP_ID = ''
# JSON file to store join requests
JOIN_REQUESTS_FILE = 'join_requests.json'
# Load existing join requests from the JSON file (if it exists)
@mewmix
mewmix / mockup
Created September 12, 2023 02:17
wget https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_win32.zip
wget https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_mac_arm64.zip
import tkinter as tk
from tkinter import filedialog
import os
from cryptography.fernet import Fernet
def open_directory_dialog():
directory_path = filedialog.askdirectory()
if directory_path:
decrypt_files_in_directory(directory_path, aes_key_entry.get())
import tkinter as tk
from tkinter import filedialog
import os
import binascii
from cryptography.fernet import Fernet
def open_directory_dialog():
directory_path = filedialog.askdirectory()
if directory_path:
decrypt_files_in_directory(directory_path, aes_key_entry.get())
@mewmix
mewmix / app.py
Created August 18, 2023 03:07
mockup api server
from flask import Flask, request, jsonify, send_file, render_template
import requests
import json
import datetime
from PIL import Image, ImageDraw, ImageFont
import io
import os
from flask_cors import CORS
@mewmix
mewmix / index.html
Last active August 18, 2023 02:35
socialtest.js
<html>
<head>
<title>GIGACORP | Social Credit Score Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="gigacorp.css">
<link rel="icon"
type="image/png"
href="img/favicon.png">
@mewmix
mewmix / test_upload.html
Created August 13, 2023 07:07
upload test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Upload</title>
</head>
<body>
<h1>Upload Image</h1>
import random
import tkinter as tk
from tkinter import messagebox
from functools import partial # Import partial from functools
import json
# Add these global variables at the top of the code
correct_answers = 0
total_answers = 0
user_responses = []
[{"name": "Deposit", "inputs": [{"name": "amount", "type": "uint256", "indexed": false}], "anonymous": false, "type": "event"}, {"name": "Withdraw", "inputs": [{"name": "amount", "type": "uint256", "indexed": false}], "anonymous": false, "type": "event"}, {"stateMutability": "nonpayable", "type": "constructor", "inputs": [{"name": "beneficiary", "type": "address"}, {"name": "withdrawalTime", "type": "uint256"}], "outputs": []}, {"stateMutability": "payable", "type": "function", "name": "receive", "inputs": [], "outputs": []}, {"stateMutability": "nonpayable", "type": "function", "name": "withdraw_beneficiary", "inputs": [], "outputs": []}, {"stateMutability": "nonpayable", "type": "function", "name": "withdraw", "inputs": [], "outputs": []}, {"stateMutability": "nonpayable", "type": "function", "name": "extend", "inputs": [{"name": "new_withdrawalTime", "type": "uint256"}], "outputs": []}, {"stateMutability": "view", "type": "function", "name": "owner", "inputs": [], "outputs": [{"name": "", "type": "address"