Skip to content

Instantly share code, notes, and snippets.

View Justaus3r's full-sized avatar
💭
still busy with (irl) stuff...

Justaus3r Justaus3r

💭
still busy with (irl) stuff...
View GitHub Profile
@Justaus3r
Justaus3r / ugly_squarebooti.py
Created August 1, 2023 11:05
A lesson on how not to code
from typing import Union, List, Tuple
# da stupidest and ugliest (with added bonus of bugs) way to calculate square root on a computer. i.e: by human division method
# Working?
# works by splitting the number into pairs , then the first pair
# is divided by a perfect square. the reminder is attached to next pair
# and the divisor is doubled and a constant is determined and attached to
# the divisor and the new divisor is multiplied by the same constant.
# we add the constant to the divisor in next iteration and we keep
# going till the reminder is 0.
@Justaus3r
Justaus3r / waa.py
Created November 10, 2022 12:10
waaaa
#!/usr/bin/env python3
# Licensed under WTF Public License
from typing import NoReturn, Union
class ZaryabFoundError(Exception):
pass
@Justaus3r
Justaus3r / .vymrc
Last active September 21, 2022 18:44
" DO NOT EDIT THIS FILE
" Add your own customizations in ~/.vim_runtime/my_configs.vim
" Modifcation to .vimrc
set runtimepath+=~/.vim_runtime
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
@Justaus3r
Justaus3r / config.py
Last active December 18, 2023 17:26
Updated: 2023-12-18 09:26:15.284291
"""
My Config for Qutebrowser
"""
import os
import sys
@Justaus3r
Justaus3r / gist:76ecbcfabe083b3194a44360ba0c00cf
Created May 9, 2021 20:02
Check for specific python modules
# Will only work for external modules
import pkg_resources
module_list = []
def check_module(Module):
for module in pkg_resources.working_set:
module_list.append(str(module).split()[0])
if Module not in module_list:
print(f"{Module} Module not found\n install it using 'pip install {Module}'")
else:
print(f'{Module} Module is installed on your System')