Code • Create • Innovate
<!-- Card Component -->
<div class="card">
<h2>Hello World</h2>
<p>Welcome to your new project.</p>
<button class="btn">Get Started</button>
</div>
.card {
background: linear-gradient(135deg, #1e293b, #334155);
border-radius: 12px;
padding: 2rem;
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}
// Interactive button functionality
const handleClick = (event) => {
const button = event.target;
button.textContent = 'Loading...';
setTimeout(() => {
button.textContent = 'Completed!';
}, 1500);
};
# Create a new repository
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin
git push -u origin main
<!-- Card with Tailwind -->
<div class="bg-gradient-to-br from-gray-800 to-gray-900 rounded-xl p-8 shadow-xl">
<h2 class="text-2xl font-bold text-white mb-4">
Tailwind CSS
</h2>
<p class="text-gray-300">
Rapidly build modern websites.
</p>
</div>
// MongoDB schema example
const userSchema = new Schema({
username: {
type: String,
required: true,
unique: true
},
email: {
type: String,
required: true
},
createdAt: {
type: Date,
default: Date.now
}
});
// Basic Express server setup
const express = require('express');
const app = express();
require('dotenv').config();
app.use(express.json());
app.use('/api/users', require('./routes/users'));
const PORT = process.env.PORT || 5000;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
// Simple HTTP server
const http = require('http');
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello from Node.js Server!');
});
const PORT = 3000;
server.listen(PORT, () => {
console.log(`Server running at http://localhost:${PORT}/`);
});
# Flask API endpoint
from flask import Flask, jsonify
app = Flask(__name__)
@app.route('/api/users')
def get_users():
users = [
{"id": 1, "name": "John Doe"},
{"id": 2, "name": "Jane Smith"}
]
return jsonify(users)
if __name__ == '__main__':
app.run(debug=True)
Loading more resources...