Skip to content

Instantly share code, notes, and snippets.

View aarmn's full-sized avatar
😎
Get Ready For ALOT!

Aarmn the limitless aarmn

😎
Get Ready For ALOT!
View GitHub Profile
@aarmn
aarmn / factorial.pl
Created March 26, 2024 11:22
2 simple programs in prolog, to get started with prolog,
% Factorial in Prolog, its as clear as it can be, no need for report.
% By AARMN The Limitless (Alireza Mohammadnezhad)
% Factorial base case
factorial(0, 1). % factorial of 0 is 1
% Factorial recursive logic
factorial(N, Return) :-
N > 0, % Not really needed, just stopping negetive values, a failsafe
NDec is N - 1, % Decrease value
@aarmn
aarmn / file.md
Last active September 26, 2023 11:16
A super useful cut of RitamChakraborty

Dark mode, Light mode image hack

<p align="right">
    <img src="./assets/hello-dark.png#gh-light-mode-only" alt="hello-dark" height="220" width="210" />
    <img src="./assets/hello-light.png#gh-dark-mode-only" alt="hello-light" height="220" width="210" />
</p>

Good links for github markdown

@aarmn
aarmn / starship.toml
Created November 7, 2022 20:46
My [close to] perfect, starship config. A continuation of pastel preset, suggestions are welcomed!
"$schema" = 'https://starship.rs/config-schema.json'
# right_format = """
# """
command_timeout = 500000000
format = """
[](#9A348E)\
[$sudo$username$hostname$localip ](bg:#9A348E)\
@aarmn
aarmn / file.ps
Created May 27, 2022 12:11
A super useful command which you can alias as wth or anything to open windows terminal powershell instance in the present working dir
wt powershell -noexit -command "cd ${pwd}"
@aarmn
aarmn / open_commands.txt
Created December 29, 2021 23:22
Opening a file in the default program from terminal in diff OSes
windows: ii (alias to -> Invoke-Item)
mac: open
linux: xdg-open (freedesktop foundation tool)
@aarmn
aarmn / git_user_stars_api.py
Last active September 20, 2021 16:10
get stars of a user
import urllib.request, json
def users_stars_raw(users):
users_stars = {}
for user in users:
i=1
users_stars[user] = []
while True:
1. powershell "start cmd -v runAs"
2. powershell -Command "Start-Process cmd -Verb RunAs"
3. use this sudo.bat code and put it in PATH:
@echo off
powershell -Command "Start-Process cmd -Verb RunAs -ArgumentList '/c cd /d %CD% && %*'"
@echo on