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
#!/bin/bash | |
file=$(find ./.changeset/ -type f -name '*.md' | grep -E '^[./a-z-]+\.md$') | |
prompt_template=$(cat <<-END | |
You are a programmer, trained to write commit messages. | |
You follow the Conventional Commits specification. | |
feat: for new features | |
chore: for maintenance work | |
fix: for bug fixes |
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 { mergeConfig } from 'vite'; | |
import path from 'path'; | |
export default { | |
framework: '@storybook/react-vite', | |
features: { | |
storyStoreV7: true, | |
}, | |
stories: [ | |
'../stories/**/*.stories.mdx', |
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 acorn, { SourceLocation } from 'acorn'; | |
import { ancestor } from 'acorn-walk'; | |
type ImportType = 'local' | 'package'; | |
function generateIndividualImport(iconName: string, type: ImportType) { | |
/** | |
* Icon name can be: | |
* - CheckCircleIconSolid - hero icon | |
* - CheckCircleIconOutline - hero icon |
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
// The default "no notifications" icon of Slack on web | |
const simpleFavicon = | |
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAFyklEQVR4nO2bPXMTVxiFz3tlyySFspqBTCiAVefGQi7CDAFnrBYmweoIjfUPLHcUEEuBIl3kX4BVBNNJDhmczkqRDzCFMBR0XgwzyWTMeCEzmcH27kkhY4y1kvZaV/5I/My4uffq7LtntOu7Z18JDJOaW7H7+tQYyWEAFgUOfc6sr6FSS8edMBr9s1ftKKKj8P0RiFgEHAFmVt+sVZ5mvg2lERYxKXbml1cTAPNNph0RTt7/LF5spZH86esx+Gy2xgVQWLhwo6WGDsYMaHPy71Aq++BsrBQ0lZy9NgFKew1g3JQJRgxIza3Y0agshlzurq4yUUvH3a2D/bNX7Sh7Q2uoN38napmi23ZlG1SnAgDQF1UTGsutvl5ktw/2oldLw4/Gchrrm2LEAJIprfWC4e1j4ouWBpTeMZvKmBCBIKWznCIfNWponhBxWmt9E8wYADiGdHYdIwYIUDOhsxcYMcDzOWlCZy8wYsDDoXiVB9QEU/cAzA/FcwfRBGMGABsmgIMgSyBqqN8cG/6kvqXdF/SYFpw/F68BjRud/YrRb8BB5NCAvS5gr3nvHpCaW7GjR9QoyBSot71tgkuBC7K0topq2EDEBHY5Z8WOxMZIpoS0KeIGhSqbj8Of/vpqTNg0iDCBA4/jDz6PV4Imk/euU1dv4cKNRKBWPVTJA7ACpl1sCVUUUA8zunzyAGAjIuUzv70e7eZBkrPXJjYSJavJEgvAd8l713MAoFJzK3aoJMcUvl9Mza1Y3ZDun71qh0yUAGAiVc5ZSjPMMEFgIGKCnYQqygdHulFMK4ICERPsJFRR0vxa6RqBgYi+itswJLT0JHBacf/syx2dxYS4nR6QgKMUdz/MUD5nAsr5WUdDyE |
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
/** | |
* Original version from: https://gist.github.com/kottenator/9d936eb3e4e3c3e02598 | |
* just typed and ready to paste 🎉 | |
*/ | |
const pagination = (c: number, m: number) => { | |
const current = c, | |
last = m, | |
delta = 2, | |
left = current - delta, | |
right = current + delta + 1, |
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
/** | |
* Deep equality of Array of Objects | |
* | |
* Omits the __proto__ from the deep equality check also | |
* The assumption here is that the Array is ordered in every check. | |
* | |
* An alternative would be JSON.stringify and then check which is slow in | |
* large array of objects | |
* | |
*/ |
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
Show hidden characters
{ | |
"Functional Default Component": { | |
"scope": "javascript,typescript,typescriptreact, javascriptreact", | |
"prefix": "rdc", | |
"body": [ | |
"export default function ${TM_FILENAME_BASE}() {", | |
" return (<>Template</>);", | |
"}" | |
], | |
"description": "Creates React functional component with default export" |
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 addStyleString(str) { | |
var node = document.createElement("style"); | |
node.innerHTML = str; | |
document.body.appendChild(node); | |
} | |
const viewportWidth = window.innerWidth; | |
const viewportHeight = window.innerHeight; | |
const new_vh = 0.01 * viewportHeight; | |
const new_vw = 0.01 * viewportWidth; |
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 addStyleString(str) { | |
var node = document.createElement("style"); | |
node.innerHTML = str; | |
document.body.appendChild(node); | |
} | |
const viewportWidth = window.innerWidth; | |
const viewportHeight = window.innerHeight; | |
const new_vh = 0.01 * viewportHeight; | |
const new_vw = 0.01 * viewportWidth; |