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 | |
# update-shadcn-components.sh | |
# Script to bulk update all shadcn/ui components in a Next.js project | |
# Usage: ./update-shadcn-components.sh | |
# Set error handling | |
set -e | |
# Check if we're in a Next.js project |
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
""" | |
Script to update pyproject.toml dependencies based on uv.lock file. | |
Prerequisites: | |
1. Python 3.11+ (for tomllib) | |
2. tomli-w package (`pip install tomli-w`) | |
3. Updated uv.lock file (`uv lock --update` or `uv lock -U`) | |
Usage: | |
1. Update your lockfile: `uv lock -U` |
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 re | |
from nltk.corpus import wordnet | |
class RepeatReplacer(object): | |
def __init__(self): | |
self.repeat_regexp = re.compile(r'(\w*)(\w)\2(\w*)') | |
self.repl = r'\1\2\3' | |
def replace(self, word): |
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 re | |
replacement_patterns = [ | |
(r'won\'t', 'will not'), | |
(r'can\'t', 'cannot'), | |
(r'i\'m', 'i am'), | |
(r'ain\'t', 'is not'), | |
(r'(\w+)\'ll', '\g<1> will'), | |
(r'(\w+)n\'t', '\g<1> not'), | |
(r'(\w+)\'ve', '\g<1> have'), |