Skip to content

Instantly share code, notes, and snippets.

View manucabral's full-sized avatar
💫

Manu manucabral

💫
View GitHub Profile
@manucabral
manucabral / sort-linked-list.cpp
Created September 21, 2021 22:23
sorting a single linked list
#include <iostream>
using namespace std;
struct Node
{
int num;
Node *next;
};
@manucabral
manucabral / converter.py
Last active September 21, 2021 22:24
pdf to string
import fitz
import pytesseract
def convert_to_img(pdf):
doc = fitz.open(pdf)
page = doc.loadPage(0)
pix = page.getPixmap()
output = f"{pdf.split(".")[0]}.png"
pix.writePNG(output)
@manucabral
manucabral / github-user-to-json.py
Last active September 21, 2021 22:25
Github user data to json
from sys import argv
import json
import requests as req
def main(user):
res = req.get(f'https://api.github.com/users/{user}')
data = res.json()
with open(f'{user}.json', 'w', encoding='utf-8') as file:
json.dump(data, file, ensure_ascii = False, indent = 4)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "utils/sqlite3.h"
#define _MAX_BUFFER 256
#define MOZ_PROFILE_PATH "\\Mozilla\\Firefox\\Profiles\\"
#define MOZ_PROFILE_TOKEN "default-release"
#define MOZ_WEB_VISITS_FILE "places.sqlite"
"""
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
@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;
@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 / 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
% 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 / 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.