Skip to main content
GhostPaste

Use Cases & Examples

See how developers use GhostPaste to share code securely in real-world scenarios

One-Time View
For passwords & secrets
1 Hour
For sensitive configs
7 Days
For code reviews
30 Days
For documentation

Code Review Snippets

Share specific code sections for review without exposing entire codebases

javascript
7 days
// Authentication middleware
function authenticate(req, res, next) {
  const token = req.headers.authorization?.split(" ")[1];
  
  if (!token) {
    return res.status(401).json({ error: "No token" });
  }
  
  try {
    const decoded = jwt.verify(token, process.env.SECRET);
    req.user = decoded;
    next();
  } catch (error) {
    res.status(403).json({ error: "Invalid token" });
  }
}

Best for: Getting feedback on specific implementations

code-review
collaboration
feedback

API Configuration

High Security

Securely share API endpoints and configuration with team members

json
1 hour
{
  "api": {
    "baseUrl": "https://api.staging.example.com",
    "version": "v2",
    "endpoints": {
      "auth": "/auth/login",
      "users": "/users",
      "products": "/products"
    },
    "headers": {
      "X-API-Version": "2.0",
      "X-Client-Id": "mobile-app-staging"
    }
  }
}

Best for: Sharing environment configs without committing to repo

config
api
staging

Interview Code Challenge

Send coding challenges and receive solutions securely

python
3 days
"""
Challenge: Implement a function that finds the longest 
palindromic substring in a given string.

Example:
  Input: "babad"
  Output: "bab" or "aba"
  
  Input: "cbbd"
  Output: "bb"

Constraints:
- 1 <= s.length <= 1000
- s consists of only lowercase English letters
"""

def longest_palindrome(s: str) -> str:
    # Your implementation here
    pass

Best for: Technical interviews and coding assessments

interview
challenge
hiring

Bug Report with Code

Share problematic code snippets when reporting bugs

javascript
30 days
// BUG: Memory leak in event listener
class DataGrid extends Component {
  componentDidMount() {
    // This listener is never removed!
    window.addEventListener("resize", this.handleResize);
    
    // Fetching data in a loop without cleanup
    this.interval = setInterval(() => {
      fetchData().then(data => {
        this.setState({ data: [...this.state.data, ...data] });
      });
    }, 1000);
  }
  
  handleResize = () => {
    console.log("Resizing...");
  }
  
  // Missing componentWillUnmount cleanup!
}

Best for: Bug reports with reproduction code

debugging
bug-report
react

Database Migrations

High Security

Share SQL migrations or schema changes for review

sql
1 day
-- Migration: Add user preferences table
BEGIN TRANSACTION;

CREATE TABLE user_preferences (
  id SERIAL PRIMARY KEY,
  user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
  theme VARCHAR(20) DEFAULT "light",
  notifications_enabled BOOLEAN DEFAULT true,
  language VARCHAR(10) DEFAULT "en",
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX idx_user_preferences_user_id ON user_preferences(user_id);

-- Add trigger for updated_at
CREATE TRIGGER update_user_preferences_updated_at
  BEFORE UPDATE ON user_preferences
  FOR EACH ROW
  EXECUTE FUNCTION update_updated_at_column();

COMMIT;

Best for: Database schema reviews before deployment

database
migration
postgresql

CSS Design Tokens

Share design system variables and theme configurations

css
7 days
:root {
  /* Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", Monaco, Consolas, monospace;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

Best for: Sharing design tokens with developers

design-system
css
theme

Shell Scripts

High Security

Share deployment or automation scripts securely

bash
1 hour
#!/bin/bash
# Deployment script for production

set -e  # Exit on error

echo "๐Ÿš€ Starting deployment..."

# Check environment
if [ "$NODE_ENV" != "production" ]; then
  echo "โŒ Error: NODE_ENV must be 'production'"
  exit 1
fi

# Build the application
echo "๐Ÿ“ฆ Building application..."
npm run build

# Run tests
echo "๐Ÿงช Running tests..."
npm test

# Deploy to server
echo "๐Ÿ“ค Deploying to production..."
rsync -avz --delete ./dist/ user@server:/var/www/app/

# Restart services
echo "๐Ÿ”„ Restarting services..."
ssh user@server "sudo systemctl restart nginx && sudo systemctl restart app"

echo "โœ… Deployment complete!"

Best for: Sharing deployment scripts with DevOps team

devops
bash
deployment

Error Stack Traces

Share error logs and stack traces for debugging

text
1 day
TypeError: Cannot read properties of undefined (reading "map")
    at ProfileList (ProfileList.tsx:45:23)
    at renderWithHooks (react-dom.development.js:14985:18)
    at updateFunctionComponent (react-dom.development.js:17356:20)
    at beginWork (react-dom.development.js:19063:16)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:16)
    
Component Stack:
    in ProfileList (at Dashboard.tsx:128)
    in div (at Dashboard.tsx:125)
    in Dashboard (at App.tsx:45)
    in Route (at App.tsx:44)
    in Switch (at App.tsx:41)
    in Router (at App.tsx:40)
    in App (at src/index.tsx:18)

Best for: Debugging production errors with team

debugging
error
stack-trace

Best Practices by Use Case

Public Sharing

  • โ€ข Remove sensitive data
  • โ€ข Use longer expiry times
  • โ€ข No production secrets
  • โ€ข Sanitize file paths

Team Sharing

  • โ€ข Set appropriate expiry
  • โ€ข Use passwords for editing
  • โ€ข Share via secure channels
  • โ€ข Document the context

Sensitive Data

  • โ€ข Use one-time view
  • โ€ข Set 1-hour expiry
  • โ€ข Verify recipient first
  • โ€ข Never post publicly

Ready to Share Your Code Securely?

Join thousands of developers who trust GhostPaste for secure code sharing. No account needed, just paste and go.