Skip to content

Commit ce98365

Browse files
committed
fix
1 parent fa44c51 commit ce98365

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

public/data/javascript.json

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -910,33 +910,6 @@
910910
"tags": ["javascript", "function", "compose", "utility"],
911911
"author": "axorax"
912912
},
913-
{
914-
"title": "Rate Limit Function",
915-
"description": "Limits how often a function can be executed within a given time window.",
916-
"code": [
917-
"const rateLimit = (func, limit, timeWindow) => {",
918-
" let queue = [];",
919-
" setInterval(() => {",
920-
" if (queue.length) {",
921-
" const next = queue.shift();",
922-
" func(...next.args);",
923-
" }",
924-
" }, timeWindow);",
925-
" return (...args) => {",
926-
" if (queue.length < limit) {",
927-
" queue.push({ args });",
928-
" }",
929-
" };",
930-
"};",
931-
"",
932-
"// Usage:",
933-
"const fetchData = () => console.log('Fetching data...');",
934-
"const rateLimitedFetch = rateLimit(fetchData, 2, 1000);",
935-
"setInterval(() => rateLimitedFetch(), 200); // Only calls fetchData twice every second"
936-
],
937-
"tags": ["javascript", "function", "rate-limiting", "utility"],
938-
"author": "axorax"
939-
},
940913
{
941914
"title": "Random string",
942915
"description": "Generates a random string of characters of a certain length",
@@ -1098,24 +1071,6 @@
10981071
],
10991072
"tags": ["javascript", "localStorage", "storage", "utility"],
11001073
"author": "axorax"
1101-
},
1102-
{
1103-
"title": "Check bytes used",
1104-
"description": "Checks the amount of bytes used in the localStorage.",
1105-
"code": [
1106-
"const checkBytesUsed = () => {",
1107-
" let spaceUsed = 0;",
1108-
" for (let i = 0; i < localStorage.length; i++) {",
1109-
" spaceUsed += localStorage.key(i).length + localStorage.getItem(localStorage.key(i)).length;",
1110-
" }",
1111-
" console.log(`Used space: ${spaceUsed} bytes`);",
1112-
"};",
1113-
"",
1114-
"// Usage:",
1115-
"checkBytesUsed();"
1116-
],
1117-
"tags": ["javascript", "localStorage", "storage", "utility"],
1118-
"author": "axorax"
11191074
}
11201075
]
11211076
},

0 commit comments

Comments
 (0)