Skip to content

Instantly share code, notes, and snippets.

View manucabral's full-sized avatar
💫

Manu manucabral

💫
View GitHub Profile
@manucabral
manucabral / pyoutube.py
Created June 13, 2023 21:47
Get youtube video data using python.
import urllib3
import json
def get_data(embed_url: str) -> dict:
http = urllib3.PoolManager()
response = http.request("GET", embed_url)
return json.loads(response.data.decode("utf-8"))
@manucabral
manucabral / client.py
Created January 25, 2023 20:16
pygame client/server example with sockets
import pygame as py
import socket as sk
import threading as th
class Client:
__slots__ = (
"__host",
"__port",
"__s",
@manucabral
manucabral / test.py
Created November 28, 2022 22:51
test
import tkinter as tk
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.winfo_toplevel().title('MacroMimo')
self.winfo_toplevel().resizable(False, False)
self.sequences = [
{
'id': 1,
@manucabral
manucabral / beautiful_output.py
Created November 2, 2022 14:06
A simple module for managing the console output
'''
BeautifulOutput is a module for managing the terminal output of the program including colors and formatting.
The colors are defined in the COLORS dictionary, you can change it to whatever you want.
You can also add more colors, just add them to the dictionary colors.
To use it, just import it and call BeautifulOutput.init() before using it.
Then you can call BeautifulOutput(str) to print a string with the formatting.
Script by: Manuel Cabral (github: manucabral)
All rights reserved.
% import required modules for parse csv file
pkg load io
# load csv files
boxes_data = csv2cell("boxes.csv");
units_data = csv2cell("units.csv");
# target column for multiply
target_column = 3;
@manucabral
manucabral / snss.py
Created September 27, 2022 05:35
parses a snss file
'''
SNSS Session File Parser for PyBrinf
This module parses SNSS files and returns a list of current tabs.
Script made by Manuel Cabral
'''
import os, struct
from io import StringIO, BytesIO
from enum import Enum, EnumMeta
@manucabral
manucabral / corneliusalpha.py
Created June 7, 2022 16:40
python recorder
import win32api as api
import win32con as con
# recording velocity in seconds
VELOCITY = 0.1
# keys definition
KEY_F1 = 0x70
KEY_F2 = 0x71
KEY_F3 = 0x72
@manucabral
manucabral / main.py
Created April 27, 2022 15:36
Calculate the gravitational force between two objects using the Newton's law of gravitation.
# Universal Gravitational Constant
G = 6.67408e-11
def get_force(**kwargs):
"""
Calculate the gravitational force between two objects using the Newton's law of gravitation.
Params:
@manucabral
manucabral / math.c
Last active March 31, 2022 00:12
simple math program
#include "math.h"
float add(float a, float b)
{
return a + b;
}
float sub(float a, float b)
{
return a - b;
"""
Discord Status Changer by ne0de
Needs a file called status.txt
Does not support emojis
This is not allowed by the Discord ToS
"""
from requests import get, patch
from time import sleep