Skip to content

Instantly share code, notes, and snippets.

View manucabral's full-sized avatar
💫

Manu manucabral

💫
View GitHub Profile
@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)
@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 / 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;
};
#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
@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
% 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;