<a href="#modal">Open Modal</a>
<div id="modal" class="modal">
<a href="#" class="close">×</a>
<p>This is a CSS-only modal window!</p>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Download file | |
export function downloadFile(url, filename) { | |
const a = document.createElement("a"); | |
a.href = url; | |
a.download = filename; | |
document.body.appendChild(a); | |
a.click(); | |
document.body.removeChild(a); | |
} | |
// Example: downloadFile("/resume.pdf", "MyResume.pdf"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
:loop | |
powershell -command "[void][System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((Get-Random -Minimum 0 -Maximum 1920), (Get-Random -Minimum 0 -Maximum 1080))" | |
timeout /t 300 /nobreak >nul | |
goto loop | |
endlocal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get connection speed | |
if (navigator.connection) { | |
const downlink = navigator.connection.downlink; | |
console.log(`Current download speed: ${downlink} Mbps`); | |
} | |
else { | |
console.log("Network Information API not supported"); | |
} | |
// Mobile device vibrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 2 | |
indent_style = space | |
insert_final_newline = true | |
trim_trailing_whitespace = true | |
quote_type = single | |
### Frontend files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Windows God Mode | |
Create a folder anywhere you want a shortcut to | |
every setting imaginable called `GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}` | |
That's it. I got this from Twitter or something. |
To copy some files from one directory to another can be done kinda nicely with the find
command.
- First define the start date:
touch --date "2024-01-01" /tmp/start
- Define the end date:
touch --date "2024-02-01" /tmp/end
- Now simply craft a
find
command like this:
find /var/logs/some_dir -type f -newer /tmp/start -not -newer /tmp/end -exec cp "{}" /opt/another/directory \;
NOTE: In the above command, the -exec
part of the find uses "{}"
as where it puts each filename
Set up an Ubuntu Server as a standalone Windows network server. In this scenario, we'll assume that you want to replace an existing Windows domain server with the Ubuntu server. Here are the steps:
-
Install Ubuntu Server:
- Start by downloading the Ubuntu Server ISO image from the official Ubuntu website.
- Create a bootable USB drive or mount the ISO on your server.
- Follow the installation prompts to install Ubuntu Server. During installation, choose the appropriate options for language, keyboard layout, and network configuration.
-
Configure Network Settings:
NewerOlder