stripe-projects
stripe projects
file-to-base64
Convert files (PDF, images) to Base64 encoding with MIME type detection for API attachments. Use when you need to prepare file attachments for the FreeAgent API or any other API that requires Base64-encoded files.
Full skill instructions
This skill converts files to Base64-encoded strings and detects their MIME types, which is essential for attaching files to FreeAgent expenses, timeslips, and other API operations that require file uploads.
Use this skill when:
.pdf) - application/pdf.png) - image/png.jpg, .jpeg) - image/jpeg.gif) - image/gif.txt) - text/plain.doc, .docx).xls, .xlsx)# Read the file and convert to Base64
base64 /path/to/file.pdf
# Get MIME type from extension
# For .pdf -> application/pdf
# For .png -> image/png
# For .jpg/.jpeg -> image/jpeg
# For .gif -> image/gif
# Check file size in bytes
stat -f%z /path/to/file.pdf # macOS
stat -c%s /path/to/file.pdf # Linux
# Convert to MB for comparison
# 5MB = 5242880 bytes
# Check if file exists and is readable
test -r /path/to/file.pdf && echo "File is readable" || echo "Cannot read file"
# Get file extension
basename /path/to/file.pdf | sed 's/.*\.//'
# 1. Validate file exists
FILE_PATH="/path/to/receipt.pdf"
test -f "$FILE_PATH" || exit 1
# 2. Check file size (must be < 5MB = 5242880 bytes)
FILE_SIZE=$(stat -f%z "$FILE_PATH")
if [ $FILE_SIZE -gt 5242880 ]; then
echo "Error: File size exceeds 5MB limit"
exit 1
fi
# 3. Get filename
FILE_NAME=$(basename "$FILE_PATH")
# 4. Determine MIME type from extension
EXT="${FILE_PATH##*.}"
case "$EXT" in
pdf) MIME_TYPE="application/pdf" ;;
png) MIME_TYPE="image/png" ;;
jpg|jpeg) MIME_TYPE="image/jpeg" ;;
gif) MIME_TYPE="image/gif" ;;
*) echo "Unsupported format"; exit 1 ;;
esac
# 5. Convert to Base64
BASE64_DATA=$(base64 "$FILE_PATH")
# 6. Output in format ready for API
echo "Attachment prepared:"
echo "- file_name: $FILE_NAME"
echo "- content_type: $MIME_TYPE"
echo "- data: [Base64 string - ${#BASE64_DATA} characters]"
# Process multiple files
for FILE in /path/to/receipts/*.pdf; do
if [ -f "$FILE" ]; then
SIZE=$(stat -f%z "$FILE")
if [ $SIZE -le 5242880 ]; then
BASE64=$(base64 "$FILE")
echo "File: $(basename "$FILE") - Ready"
else
echo "File: $(basename "$FILE") - Too large"
fi
fi
done
| Extension | MIME Type |
|---|---|
| application/pdf | |
| .png | image/png |
| .jpg, .jpeg | image/jpeg |
| .gif | image/gif |
| .txt | text/plain |
| .doc | application/msword |
| .docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| .xls | application/vnd.ms-excel |
| .xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
File not found
test -f "$FILE_PATH" || echo "Error: File does not exist"
File too large
SIZE=$(stat -f%z "$FILE_PATH")
MAX_SIZE=5242880 # 5MB
[ $SIZE -gt $MAX_SIZE ] && echo "Error: File exceeds 5MB limit"
Unsupported format
EXT="${FILE_PATH##*.}"
case "$EXT" in
pdf|png|jpg|jpeg|gif) echo "Supported" ;;
*) echo "Error: Unsupported format. Use: pdf, png, jpg, jpeg, gif" ;;
esac
Permission denied
test -r "$FILE_PATH" || echo "Error: Cannot read file (check permissions)"
| Task | macOS | Linux |
|---|---|---|
| File size | stat -f%z file | stat -c%s file |
| Base64 encode | base64 file | base64 file |
| Base64 (no wrap) | base64 file | base64 -w 0 file |
When using this skill to prepare attachments for FreeAgent:
{
"attachment": {
"data": "base64_encoded_string",
"file_name": "receipt.pdf",
"content_type": "application/pdf",
"description": "Receipt for office supplies"
}
}
stripe projects
Harvest every `ponytail:` comment in the codebase into a debt ledger, so the deliberate shortcuts and deferrals ponytail leaves behind get tracked instead of rotting into "later means never". One-shot report, changes nothing.
okx dex market
okx agentic wallet
gmgn portfolio
okx dapp discovery
okx agent payments protocol
Stripe payment processing with checkout sessions, subscriptions, webhooks, and customer management.
Build comprehensive 3-5 year financial models with revenue projections, cost structures, cash flow analysis, and scenario planning for early-stage startups. Use this skill when creating financial projections, calculating burn rate or runway, modeling fundraising scenarios, or preparing investor-r...
Stock and cryptocurrency analysis with portfolio management and multi-dimensional scoring.
Real-time crypto derivatives positioning, whale tracking, liquidations, and institutional ETF flows across 37 specialized tools.
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Stay Ahead with Finalle.ai: The Ultimate Financial News and Tools Platform
AI-powered Pine Script code generator for TradingView
Research stocks at the speed of thought.
Empower your investment strategies with AI signals, option flow data, and advanced chart patterns.
Danelfin review covering its AI stock and ETF scores, rankings, portfolio tools, current pricing, strengths, risks, and alternatives for investors.
A software for comprehensive market sentiment analysis.
'Stock Correlations' App by Freshly.ai: Reveal Stock Patterns and Trends