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 / 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 / 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 / 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 / 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 / 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>