SELECT
c.customer_id,
c.segment,
SUM(t.amount) AS total_spent
FROM customers c
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
| html { | |
| scroll-behavior: smooth; | |
| } | |
| .section { | |
| transform: translateZ(0); /* force GPU layer */ | |
| will-change: transform; | |
| } |
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
findcommand 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