Source: Claude.ai
I've created a Python script that expands t.co URLs in a Twitter archive. Here's how to use it:
- Install the required packages:
pip install requests tqdm
- Run the script with your Twitter archive path:
Source: Claude.ai
I've created a Python script that expands t.co URLs in a Twitter archive. Here's how to use it:
pip install requests tqdm
What is the minimal boilerplate around the web API fetch()
call to support
similar to the very popular axios
library without relying on 3rd party libraries or implement the full axios
API?
To create a minimal boilerplate around the native fetch()
API that mimics some of axios
's popular features—such as request interception, progress tracking, and error handling—you can build a wrapper function or a simple class. Below is an example of how to achieve this without relying on third-party libraries.
The provided gcm
shell function is an innovative tool that leverages an AI-powered language model (LLM) to generate concise Git commit messages based on staged changes. This automation enhances workflow efficiency by reducing the cognitive load associated with crafting commit messages manually. Below is a comprehensive analysis of the existing code, along with detailed recommendations for optimizations and improvements to both the codebase and user experience.
The gcm
function performs the following steps:
git diff --cached
) while excluding specific lock files (pnpm-lock.yaml
, package-lock.json
, yarn.lock
).# ----------------------------------------------------------------------------- | |
# Enhanced AI-powered Git Commit Function with Optimizations and UX Improvements | |
# Add this to your ~/.bashrc or ~/.zshrc to utilize the `gcm` command. | |
# Features: | |
# 1) Validates required dependencies. | |
# 2) Checks for staged changes. | |
# 3) Allows customizable exclusion patterns. | |
# 4) Generates commit messages using an LLM with an extended prompt. | |
# 5) Provides user-friendly prompts with color-coded messages. | |
# 6) Handles errors gracefully with informative feedback. |
from bs4 import BeautifulSoup | |
import subprocess | |
import re | |
# Any OpenRouter model page should do the trick, e.g. | |
# curl https://openrouter.ai/models/google/gemini-flash-1.5 > or.html | |
# Due to skill issues this script needs prettier installed to format the code | |
# so Python can correctly search it with RegEx |