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
| export default function (Alpine) { | |
| const findInParent = (prop) => (el) => { | |
| while (el && !el[prop]) el = el.parentElement | |
| return el?.[prop] | |
| } | |
| Alpine.magic('attrs', findInParent('_x_attrs')) | |
| Alpine.magic('props', findInParent('_x_props')) | |
| Alpine.magic('slots', findInParent('_x_slots')) | |
| Alpine.directive('component', xComponentDirective) |
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
| // Usage: | |
| // console.log(await new PromisedValue([1,2,3]).map(x => x * 2).filter(x => x % 2)) | |
| // | |
| // instead of this: | |
| // console.log(await Promised.resolve([1,2,3]) | |
| // .then(arr => arr.map(x => x * 2)) | |
| // .then(arr => arr.filter(x => x % 2))) | |
| export function PromisedValue(target) { | |
| target = Promise.resolve(target) |
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 | |
| # Find all git repositories recursively and print those with uncommitted changes | |
| # Find all .git directories | |
| find . -type d -name ".git" 2>/dev/null | while read -r git_dir; do | |
| # Get the repository root (parent of .git directory) | |
| repo_path=$(dirname "$git_dir") | |
| # Convert to absolute path |
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 | |
| # Usage | |
| # USERNAME=username ./clone-all-github.sh | |
| # Ensure gh CLI is installed | |
| if ! command -v gh &> /dev/null; then | |
| echo "gh CLI not found." | |
| exit 1 | |
| fi |
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 | |
| # --- Configuration --- | |
| # GITLAB_URL and GITLAB_TOKEN must be set as environment variables | |
| if [ -z "$GITLAB_URL" ]; then | |
| echo "ERROR: GITLAB_URL environment variable is not set" | |
| exit 1 | |
| fi | |
| if [ -z "$GITLAB_TOKEN" ]; then |
OlderNewer