class DeadlineError extends Error {
constructor(message = 'request deadline exceeded') {
super(message);
this.name = 'DeadlineError';
this.code = 'DEADLINE_EXCEEDED';
}
package com.example.caching.config;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.ShallowEtagHeaderFilter;
import asyncio
import time
from dataclasses import dataclass
from typing import Any, Dict
package com.example.http;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.http.client.ClientHttpRequestInterceptor;
const DEFAULTS = {
baseDelay: 300,
maxDelay: 8000,
factor: 2,
jitter: 0.5,
};
class DiscountCode < ApplicationRecord
has_many :redemptions, dependent: :destroy
enum discount_type: { percentage: 0, fixed: 1 }
validates :code, presence: true, uniqueness: { case_sensitive: false }
public class PayloadLimitFilter extends OncePerRequestFilter {
private final long maxBytes;
private final Set<String> allowedTypes;
public PayloadLimitFilter(long maxBytes, Set<String> allowedTypes) {
const { AsyncLocalStorage } = require('async_hooks');
const storage = new AsyncLocalStorage();
function runWithTenant(tenantId, userId, callback) {
return storage.run({ tenantId, userId }, callback);
<?php
namespace App\Policies;
use App\Models\Article;
use App\Models\User;
@RestController
@RequestMapping("/api/products")
public class ProductController {
private final ProductRepository repository;
private final JsonMergePatchService patchService;
package webhooksign
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
export interface UseClipboardResult {
copied: boolean;
error: Error | null;
copy: (value: string) => Promise<boolean>;
}