Skip to content

Commit 5a0b51f

Browse files
committed
repo: hygiene
1 parent 9679363 commit 5a0b51f

31 files changed

Lines changed: 3883 additions & 112 deletions

.gitignore

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1-
.DS_Store
2-
.vscode/
1+
# Dipendenze
32
node_modules/
4-
byp yt music/
3+
package-lock.json
4+
yarn.lock
5+
6+
# Build e Dist
7+
dist/
8+
build/
9+
10+
# CodeCorn Staging & Backup
11+
_FREEZE/
12+
_STASH/
513
_PREV/
6-
_FREEZE/_PREV/
7-
_FREEZE/_PREV
14+
_DEV/
15+
_SHIT/
16+
17+
# OS e Logs
18+
.DS_Store
19+
*.log
20+
*.zip
21+
*.tar.gz
22+
23+
# Ambiente
24+
.env
25+
.env.local
26+
secrets/

.prettierignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ pnpm-lock.yaml
1919

2020
# Varie
2121
.DS_Store
22-
*.log
22+
*.log
23+
24+
# Ignora cartelle di staging
25+
_FREEZE/
26+
_STASH/
27+
_PREV/
28+
_DEV/
29+
_SHIT/

.vscode/settings.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"workbench.colorCustomizations": {
3+
"activityBar.activeBackground": "#0000b3",
4+
"activityBar.background": "#0000b3",
5+
"activityBar.foreground": "#e7e7e7",
6+
"activityBar.inactiveForeground": "#e7e7e799",
7+
"activityBarBadge.background": "#df0000",
8+
"activityBarBadge.foreground": "#e7e7e7",
9+
"commandCenter.border": "#e7e7e799",
10+
"sash.hoverBorder": "#0000b3",
11+
"statusBar.background": "#000080",
12+
"statusBar.foreground": "#e7e7e7",
13+
"statusBarItem.hoverBackground": "#0000b3",
14+
"statusBarItem.remoteBackground": "#000080",
15+
"statusBarItem.remoteForeground": "#e7e7e7",
16+
"titleBar.activeBackground": "#000080",
17+
"titleBar.activeForeground": "#e7e7e7",
18+
"titleBar.inactiveBackground": "#00008099",
19+
"titleBar.inactiveForeground": "#e7e7e799"
20+
},
21+
"peacock.color": "#000080"
22+
}

.vscode/task_shortcuts.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Per fare una pulizia massiva di tutte le righe vuote (da `^` a `$`) in un intero documento, dobbiamo aggirare un limite fisiologico di VS Code: il motore nativo non permette di eseguire un *Trova e Sostituisci Tutto* in modo completamente silente tramite una singola scorciatoia, a meno di non usare un'estensione.
2+
3+
Ma visto che ci piace sporcarci le mani e padroneggiare il `keybindings.json`, abbiamo due strade. La prima è 100% nativa e sfrutta proprio le regex che hai citato.
4+
5+
### Opzione 1: Il "Cecchino" Nativo (Regex Pre-armata)
6+
7+
Possiamo creare una combo che apre il pannello di Replace **già pre-compilato** con la regex perfetta e la modalità Regex (`.*`) attivata. A te basterà premerla e dare una singola conferma (`Cmd + Enter`) per piallare tutte le righe.
8+
9+
Apri il tuo `keybindings.json` e aggiungi questo blocco:
10+
11+
```json
12+
{
13+
"key": "cmd+alt+backspace",
14+
"command": "editor.actions.findWithArgs",
15+
"args": {
16+
"searchString": "^\\s*$\\n",
17+
"replaceString": "",
18+
"isRegex": true
19+
},
20+
"when": "editorTextFocus"
21+
}
22+
23+
```
24+
25+
**Come funziona l'innesco:**
26+
27+
1. Premi `Cmd + Option + Backspace` (o cambiala con la combo che preferisci).
28+
2. VS Code apre il pannello *Trova e Sostituisci*.
29+
3. La regex `^\s*$\n` viene caricata in automatico. Questa espressione è letale: prende l'inizio della riga (`^`), eventuali spazi o tab invisibili (`\s*`), la fine della riga (`$`) e il ritorno a capo successivo (`\n`).
30+
4. Tu devi solo premere `Cmd + Enter` (Replace All) e il documento viene ripulito istantaneamente.
31+
32+
---
33+
34+
### Opzione 2: L'Esecuzione Silente (Richiede Estensione)
35+
36+
Se vuoi l'effetto "un solo tasto e sparisce tutto" senza nemmeno vedere il pannello di ricerca comparire, devi appoggiarti a un'estensione leggerissima che fa solo questo.
37+
38+
1. Installa l'estensione **Remove Empty Lines** (id: `saperb.remove-empty-lines`).
39+
2. Una volta installata, il comando diventa disponibile anche nella Command Palette (`Cmd + Shift + P` -> *Remove Empty Lines*).
40+
3. Per mapparlo sulla tua combo, aggiungi questo al `keybindings.json`:
41+
42+
```json
43+
{
44+
"key": "cmd+alt+backspace",
45+
"command": "extension.removeEmptyLines",
46+
"when": "editorTextFocus"
47+
}
48+
49+
```
50+
51+
### Nota Extra: La riga singola
52+
53+
Se invece il tuo intento era semplicemente eliminare **la singola riga** (vuota o piena che sia) su cui si trova attualmente il cursore senza doverla selezionare da capo a coda, VS Code ha già la combo nativa cablata di default: ti basta premere `Cmd + Shift + K` (`editor.action.deleteLines`).

.vscode/tasks.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "CodeCorn: Help Folding",
6+
"type": "shell",
7+
"command": "echo '\n🚀 === CODECORN FOLDING CHEATSHEET ===\n\nCmd + Alt + Giù 👉 Chiudi tutto il documento\nCmd + Alt + Su 👉 Apri tutto il documento\nCmd + Alt + Invio 👉 Toggla (apri/chiudi) il blocco corrente\nCmd + Alt + Sx 👉 Chiudi il blocco corrente\nCmd + Alt + Dx 👉 Apri il blocco corrente\n\n======================================\n'",
8+
"presentation": {
9+
"echo": false,
10+
"reveal": "always",
11+
"focus": true,
12+
"panel": "shared",
13+
"clear": true,
14+
},
15+
"problemMatcher": [],
16+
},
17+
],
18+
}

_FREEZE/4.1.15.zip

-694 KB
Binary file not shown.

index.html

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22
"name": "codecorn-userscripts",
33
"version": "4.17.2",
44
"description": "A collection of advanced Tampermonkey userscripts crafted for debugging, automation, and UI manipulation",
5-
"main": "index.js",
65
"scripts": {
7-
"test": "prettier --check \"**/*.js\"",
6+
"test": "npm run format:checktest && echo 'Running live server...' && npm run dev",
87
"dev": "serve . -p 8765 --cors -l tcp://localhost",
9-
"format": "prettier --write \"**/*.js\"",
8+
"format": "prettier --write \"**/*.{js,json,md}\"",
9+
"format:checktest": "prettier --check \"**/*.js\"",
10+
"format:js": "prettier --write \"**/*.js\"",
11+
"sync-version": "node scripts/sync-versions.js",
12+
"preversion": "npm run format:js",
13+
"version": "npm run sync-version && git add -u",
14+
"postversion": "git push && git push --tags",
15+
"freeze": "bash scripts/_cc-freeze.sh",
1016
"build:godmode": "terser god-mode-console/CodeCorn_GodMode.user.js -o god-mode-console/dist/CodeCorn_GodMode.min.user.js --compress --mangle --comments \"/^!/\"",
1117
"clean:prev": "find . -type d -name '_PREV' -exec rm -rf {} +",
1218
"new:script": "bash -c 'mkdir -p \"$0\" && cp template/jsconfig.json \"$0/\" && touch \"$0/$0.user.js\"' ",

prefreeze/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

prefreeze/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
.vscode/
3+
node_modules/
4+
byp yt music/
5+
_PREV/
6+
_FREEZE/_PREV/
7+
_FREEZE/_PREV

0 commit comments

Comments
 (0)