Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3a37f36

Browse files
committed
Merge branch 'main' of https://github.com/Axorax/quicksnip
2 parents c5147e0 + d2c5024 commit 3a37f36

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

‎public/consolidated/all_snippets.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,23 @@
16451645
"promises"
16461646
],
16471647
"author": "0xHouss"
1648+
},
1649+
{
1650+
"title": "Random string",
1651+
"description": "Generates a random string of characters of a certain length",
1652+
"code": [
1653+
"function makeid(length, characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {",
1654+
" return Array.from({ length }, () => characters.charAt(Math.floor(Math.random() * characters.length))).join('');",
1655+
"}",
1656+
"",
1657+
"console.log(makeid(5), \"1234\" /* (optional) */);"
1658+
],
1659+
"tags": [
1660+
"javascript",
1661+
"function",
1662+
"random"
1663+
],
1664+
"author": "kruimol"
16481665
}
16491666
]
16501667
},

‎public/data/javascript.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,19 @@
963963
],
964964
"tags": ["javascript", "function", "rate-limiting", "utility"],
965965
"author": "axorax"
966+
},
967+
{
968+
"title": "Random string",
969+
"description": "Generates a random string of characters of a certain length",
970+
"code": [
971+
"function makeid(length, characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {",
972+
" return Array.from({ length }, () => characters.charAt(Math.floor(Math.random() * characters.length))).join('');",
973+
"}",
974+
"",
975+
"console.log(makeid(5), \"1234\" /* (optional) */);"
976+
],
977+
"tags": ["javascript", "function", "random"],
978+
"author": "kruimol"
966979
}
967980
]
968981
},

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /