class Coupon < ApplicationRecord
before_validation :normalize_code
validates :code,
coupon_code: { min_length: 6 },
uniqueness: { case_sensitive: false }
@RestController
@RequestMapping("/api/products")
public class ProductController {
private final ProductRepository repository;
private final JsonMergePatchService patchService;
const SHUTDOWN_TIMEOUT_MS = 10_000;
function registerFatalHandlers({ logger, onFatal, exitCode = 1 }) {
let shuttingDown = false;
async function handleFatal(kind, error) {
<?php
namespace App\Services\RateLimit;
use Illuminate\Support\Facades\Redis;
from typing import List, Optional
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from .dataloader import DataLoader
package mailer
import (
"crypto/sha256"
"encoding/hex"
"strings"
import { Knex } from 'knex';
export interface RawDailyRow {
day: string;
order_count: string;
gross_cents: string;
<h1>New Article</h1>
<form action="/articles" method="post">
<div>
<label for="title">Title</label>
<input id="title" type="text" name="article[title]"
package com.example.security;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.security.Keys;
import org.springframework.beans.factory.annotation.Value;
const sharp = require('sharp');
const DEFAULTS = {
maxWidth: 1600,
maxHeight: 1600,
format: 'webp',
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use std::collections::HashMap;
use std::path::PathBuf;
use walkdir::WalkDir;
pub fn group_by_size(root: &str) -> HashMap<u64, Vec<PathBuf>> {