yaml

yaml
production:
  primary:
    adapter: postgresql
    database: app_production
    username: app
    password: <%= ENV["PRIMARY_DB_PASSWORD"] %>

Read Replica Routing for GET-Heavy Endpoints

rails activerecord postgres
by codesnips 4 tabs
java
package com.example.storage;

import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;

Bind and Validate Grouped App Settings with @ConfigurationProperties in Spring Boot

spring-boot configuration validation
by codesnips 3 tabs
yaml
name: CI

on:
  push:
    branches: [main]
  pull_request:

GitHub Actions: cache + tests + build

ci github-actions node
by codesnips 3 tabs
bash
#!/bin/bash
# Helm commands

# Add repositories
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update

Kubernetes Helm charts for package management

kubernetes helm charts
by Ryan Nakamura 4 tabs
java
package com.example.demo.service;

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Timer;
import org.springframework.stereotype.Service;

Actuator for production monitoring

java spring-boot actuator
by David Kumar 4 tabs
bash
#!/bin/bash
# Docker Compose commands

# Start all services
docker compose up -d

Docker Compose for multi-container applications

docker docker-compose devops
by Ryan Nakamura 2 tabs
java
package com.example.demo.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

Microservices with Spring Cloud

java spring-cloud microservices
by David Kumar 3 tabs
yaml
stages:
  - lint
  - test
  - build
  - deploy

CI/CD pipeline with GitLab CI

ci-cd gitlab devops
by Ryan Nakamura 1 tab
ruby
class Cart < ApplicationRecord
  has_many :cart_items, dependent: :destroy

  EXPIRY_WINDOW = 2.hours

  scope :active, -> { where(state: :active) }

Expire Stale Shopping Carts With a Rails Scope and a Recurring Reaper Job

rails activerecord background-jobs
by codesnips 3 tabs
yaml
# Prometheus configuration
global:
  scrape_interval: 15s
  evaluation_interval: 15s
  scrape_timeout: 10s

Prometheus monitoring and alerting configuration

prometheus monitoring alerting
by Ryan Nakamura 2 tabs
yaml
repos:
  - repo: https://github.com/gitleaks/gitleaks
    rev: v8.18.4
    hooks:
      - id: gitleaks
  - repo: https://github.com/Yelp/detect-secrets

Git secret scanning with pre commit hooks

git secrets scanning
by Kai Nakamura 1 tab
php
<?php

namespace App\Security\Voter;

use App\Entity\Comment;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

Enforce Comment Ownership With a Symfony Voter and Controller Authorization Check

symfony security voter
by codesnips 3 tabs