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 / Responsive CSS Only Popup.html
Last active March 31, 2024 21:57
Pure CSS responsive popups solution
<label for="1">CLICK 1!</label>
<label for="2">CLICK 2!</label>
<label for="3">CLICK 3!</label>
<div class="popups">
<input type="checkbox" id="1" />
<div class="modal">
<div class="modal__inner">
<p>1</p>
@burgil
burgil / mov2mp4.py
Last active April 22, 2024 00:45
Flawlessly compress MOV file to MP4 for faster web streaming (I just compressed 158MB with it to just 12MB in less than two minutes and I compared between the two, the new file actually looks better and much less glitchy)
import subprocess
def compress_mov_to_mp4_ffmpeg(input_file, output_file, bitrate='1000k'):
command = ['ffmpeg', '-i', input_file, '-b:v', bitrate, output_file]
subprocess.call(command)
# Example usage
compress_mov_to_mp4_ffmpeg('input.mov', 'output.mp4')
@burgil
burgil / Super nice scrollbar.css
Last active May 28, 2024 13:34
A super nice scrollbar in CSS
::-webkit-scrollbar {
width: 0.3em;
height: 0.3em;
overflow-x: none;
}
::-webkit-scrollbar-track {
background-color: #f1f1f1;
border-radius: 0.3em;
}
::-webkit-scrollbar-thumb {
@burgil
burgil / linux.py
Last active March 26, 2024 20:23
Super Simple Simulated Linux Terminal for Python with support for cat, ls, cd and exit commands - Enjoy!
class Terminal:
def __init__(self):
self.root = {
"": {
"directories": ["Documents", "Downloads"],
"files": []
},
"Documents": {
"directories": [],
"files": {
@burgil
burgil / Password tricks + Enable deleting password on CTRL+X - GG.js
Last active April 22, 2024 02:25
(FYI I am moving to passwordless (and serverless) architecture so I am dumping here anything password-related) - Password Tricks: When you press CTRL+X on an HTML password input it will not delete the text, if it annoys you, this will fix it + More stuff
for (const passwordInput of document.querySelectorAll('input[type=password]')) {
passwordInput.addEventListener('keydown', function (event) {
if (this.getAttribute('type') !== 'password') return;
if (event.ctrlKey && event.key === 'x') this.value = '';
});
}
@burgil
burgil / ResetStyle.css
Created March 31, 2024 03:28
A useful CSS style to reset the browser styling
*, ::after, ::before {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: #e5e7eb
}
::after, ::before {
--tw-content: ''
}
:host, html {
@burgil
burgil / view-and-uninstall-installed-python-libraries.md
Created March 31, 2024 17:30
This Gist answers the questions: "How can I view all the installed pip packages?" and "How can I uninstall all pip packages in windows?"

How can I view all the installed pip packages?

python freeze

How can I uninstall all pip packages in windows?

for /F "delims==" %i in ('pip freeze') do pip uninstall -y %i
@burgil
burgil / overcome-login-account-list.md
Last active April 15, 2024 00:59
Bullet Proof Login, Register and Forgot Pass System

Bullet Proof Login, Register and Forgot Pass System:

Login

  • Valid email + valid password = login success
  • Valid email + invalid password = incorrect details error
  • Unregistered email + some password = incorrect details error

Register

(The tricky part where the magic happens)

@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 !== '.');
@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;