name: CI Pipeline
on:
push:
branches: [main, develop]
pull_request:
# HPA v2 with multiple metrics
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web-app-hpa
namespace: production
# ConfigMap from literal values
apiVersion: v1
kind: ConfigMap
metadata:
name: web-app-config
namespace: production
# ClusterIP Service (internal only)
apiVersion: v1
kind: Service
metadata:
name: web-app
namespace: production
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-app
namespace: production
labels:
#!/bin/bash
# Docker Compose commands
# Start all services
docker compose up -d
# Multi-stage build for a Node.js application
# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
/* 1. Mobile-first approach */
/* Base styles for mobile */
.container {
width: 100%;
padding: 1rem;
}
// 1. Basic types
let username: string = 'Alex';
let age: number = 30;
let isActive: boolean = true;
let items: string[] = ['item1', 'item2'];
let numbers: Array<number> = [1, 2, 3];
// 1. Create SVG elements
const svgNS = 'http://www.w3.org/2000/svg';
function createSVGElement(type, attributes = {}) {
const element = document.createElementNS(svgNS, type);
Object.entries(attributes).forEach(([key, value]) => {
// Get canvas and context
const canvas = document.getElementById('myCanvas');
const ctx = canvas.getContext('2d');
// 1. Basic shapes
// Rectangle (filled)
// 1. Basic WebSocket connection
const socket = new WebSocket('wss://example.com/ws');
// Connection opened
socket.addEventListener('open', (event) => {
console.log('Connected to WebSocket server');