Skip to content

Instantly share code, notes, and snippets.

View burgil's full-sized avatar
🏠
Working from home

Burgil‬‏ burgil

🏠
Working from home
View GitHub Profile
@burgil
burgil / advanced-updater.sh
Last active May 6, 2024 17:41
Auto Update Linux Server When GitHub Repository Changes
#!/bin/bash
OWNER="burgil"
REPO_NAME="Example"
get_latest_commit() {
curl -s "https://api.github.com/repos/$OWNER/$REPO_NAME/commits/main" | grep '"sha"' | head -n 1 | cut -d '"' -f 4
}
LAST_COMMIT=$(get_latest_commit)
while true; do
@burgil
burgil / strapi.md
Last active April 22, 2024 06:50
Using Strapi? Check this out!
@burgil
burgil / memory.burgil.ai.json
Created April 22, 2024 03:50
Me - As seen through AI "eyes" - A memory footprint of myself in JSON format
{
"name": "Alien Burgil",
"age": 27,
"years_of_experience": 13,
"occupation": "Super Freelancer",
"location": "Earth",
"proficiency": "Master of Logistics, Kick-Ass Developer, Technoking",
"GitHub": "https://github.com/burgil",
"system_requirements": {
"english_proficiency": true,
@burgil
burgil / ollama.py
Last active April 26, 2024 21:03
Python - use the OpenAI library with a local LLM (Ollama)
from openai import OpenAI
client = OpenAI(
base_url = 'http://localhost:11434/v1',
api_key='ollama', # required, but unused
)
response = client.chat.completions.create(
model="mistral",
messages=[
@burgil
burgil / settings.json
Created April 22, 2024 00:42
Change Live Server Port - Simply create a new folder named .vscode (if it doesn't already exist) and add the following file in it / line if it already exist
{
"liveServer.settings.port": 4242
}
@burgil
burgil / folder space cleaner.py
Created April 21, 2024 22:45
Mass remove spaces from folders in the current directory using python - Use `python "folder space cleaner.py"` and all the folders in the *current directory will be renamed and the spaces will be removed
import os
def remove_spaces_from_folders():
current_dir = os.getcwd()
folders = [f for f in os.listdir(current_dir) if os.path.isdir(os.path.join(current_dir, f))]
for folder in folders:
if ' ' in folder:
new_name = folder.replace(' ', '')
@burgil
burgil / bulk rename txt to html.cmd
Created April 21, 2024 22:43
CMD Mass Renamer (Rename all files in the current directory with `.txt` extension to `.html`)
@echo off
for %%f in (*.txt) do (
ren "%%f" "%%~nf.html"
)
@burgil
burgil / beep disabler.cmd
Created April 21, 2024 22:42
Turning off the annoying beep sound when using CHOICE in the command prompt (cmd) on Windows
@echo off
title Disabling Annoying Beep Sounds...
echo Disabling Annoying Beep Sounds...
net stop beep
echo Annoying Beep Sounds Disabled!
title Annoying Beep Sounds Disabled!
pause
@burgil
burgil / burgil-notify.css
Last active April 24, 2024 12:42
A robust, decent looking, notification system for your website frontend: fading animations - closable popups - controllable time delay - smart queue - 4 types of icons: warning, error, success, info and none (easily add more) - no highlight buttons (user select none) - 1 function, 1 CSS file and 1 line of html code and it's yours.
.notification-container {
width: 100%;
max-width: fit-content;
position: fixed;
top: 10px;
right: 10px;
z-index: 9999;
display: flex;
flex-direction: column;
align-items: flex-end;
@burgil
burgil / evalMath.js
Last active April 18, 2024 02:51
#Fixed math, the universe and everything in between ! Serverless compatible Math-Only JavaScript EVAL ! Introducing math eval - A math only eval that can actually calculate numbers unlike python and javascript lol, and does not require any library
const evalMath = (str) => {
const operatorToFunction = {
"+": (a, b) => a + b,
"-": (a, b) => a - b,
"*": (a, b) => a * b,
"/": (a, b) => a / b
};
const operationStr = str.replace(/\s/g, '');
const numbers = operationStr.split(/[-+*/]/).map(Number);
const operators = operationStr.split(/\d+/).filter(Boolean).filter(operator => operator !== '.');