Skip to content

Instantly share code, notes, and snippets.

@adrifmonte
adrifmonte / truncateConstToSentryMaxLength.js
Last active September 13, 2025 05:35
truncate const case str to fit sentry maximum length
// shorten constant to fit maximum length accepted by sentry
const shortenConstant = (constantCaseString, maxlength = 25, separator = '_') => {
// no need to shorten
if (!constantCaseString || constantCaseString.length < maxlength) {
return constantCaseString;
}
// abbreviate each word to fit the max length
const splittedConstantCaseTokens = constantCaseString.split(separator);
if (splittedConstantCaseTokens.length > 1) {
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active November 5, 2025 16:18
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@lubien
lubien / A-umbrella.md
Last active September 7, 2023 17:45
Umbrella Challenge

Umbrella Challenge

Given a number of people N and an array of integers, each one representing the amount of people a type of umbrella can handle, output the minimum number of umbrellas needed to handle N people.

No umbrella could have left spaces. Which means if a umbrella can handle 2 people, there should be 2 people under it.

If there's no solution, return -1.

Examples