[Provide a detailed description of the changes introduced by this pull request. Include any relevant context.]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* High-Performance JavaScript Bitwise Operations Library | |
* A collection of efficient functions using bitwise operators to replace common JavaScript operations | |
*/ | |
/** | |
* Converts the target value to an integer using the bitwise OR operator. | |
* ~76% faster than parseInt(target, 10) | |
* | |
* @param {string|number} target - The target number to parse to integer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"> | |
<style> | |
path { | |
fill: #000; | |
} | |
@media (prefers-color-scheme: dark) { | |
path { | |
fill: #fff; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generates a random ID with the given prefix. | |
* @param prefix - The prefix to be added to the generated ID. | |
* @returns The generated random ID. | |
*/ | |
export const generateRandomId = (prefix: string) => | |
`${prefix}${btoa(Date.now().toString())}${btoa( | |
(Math.random() * 1_000_000_000_000).toString() | |
)}`.replace(/=+/g, ""); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Prod | |
on: | |
workflow_dispatch: | |
jobs: | |
publish-npm: | |
environment: prod | |
runs-on: ubuntu-latest | |
defaults: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Zed settings | |
// | |
// For information on how to configure Zed, see the Zed | |
// documentation: https://zed.dev/docs/configuring-zed | |
// | |
// To see all of Zed's default settings without changing your | |
// custom settings, run the `open default settings` command | |
// from the command palette or from `Zed` application menu. | |
{ | |
"autosave": "on_window_change", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from "fs"; | |
function readDirectory(path, depth = 0) { | |
const indent = " ".repeat(depth * 2); | |
const files = fs.readdirSync(path); | |
for (const file of files) { | |
const filePath = `${path}/${file}`; | |
const stats = fs.statSync(filePath); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rawMarkdown(markdown) { | |
const regex = /(\*{1,2}|_{1,2}|`{1,3}|~{1,2}|#{1,6}|!{0,1}\[.*?\]\(.*?\)|>{1}|`{1,2}|!\[.*?\]\(.*?\))/g | |
const noMarkdown = markdown.replace(regex, '') | |
return noMarkdown | |
} | |
const markdown = ` | |
# H1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function forEach(arr, callback) { | |
// for each element in the arr, run the callback, passing in the element | |
for (let i = 0; i < arr.length; i++) { | |
callback(arr[i], i) | |
} | |
} | |
module.exports = forEach; |
NewerOlder