Alvin Novian
Back to index

Miscellaneous resources

Curried Function

Clone Private GIT with 2FA enabled

Firefox input bug

Focus Visible Resources

SVG Circular Percentage

<svg viewBox="0 0 36 36">
  <path
    d="M18 2.0845
      a 15.9155 15.9155 0 0 1 0 31.831
      a 15.9155 15.9155 0 0 1 0 -31.831"
    fill="none"
    stroke="#444"
    stroke-width="1"
  />
</svg>

Regex from array

const strings = ["en", "id", "fr"];
const stringsJoin = strings.join("|");
const regex = new RegExp(`^anything\.com\/(${stringsJoin})`);

// this is equivalent to
// /^anything\.com\/(en|id|fr)/