local key = KEYS[1]
local capacity = tonumber(ARGV[1])
local rate = tonumber(ARGV[2])
local now = tonumber(ARGV[3])
local ttl = tonumber(ARGV[4])
package com.example.security;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.security.Keys;
import org.springframework.beans.factory.annotation.Value;
@Configuration
@EnableScheduling
@EnableConfigurationProperties(CleanupProperties.class)
public class SchedulingConfig {
@Bean(destroyMethod = "shutdown")
import { AxiosError } from 'axios';
export const RETRY_CONFIG = {
maxRetries: 4,
baseDelayMs: 200,
maxDelayMs: 5_000,
import asyncio
from collections import defaultdict
from fastapi import WebSocket
import { SetMetadata } from '@nestjs/common';
export enum Role {
User = 'user',
Editor = 'editor',
Admin = 'admin',
use std::cmp::{Ordering, Reverse};
#[derive(Debug, Clone)]
pub struct ScheduledTask<T> {
pub priority: u8,
pub seq: u64,
class Cart < ApplicationRecord
has_many :cart_items, dependent: :destroy
EXPIRY_WINDOW = 2.hours
scope :active, -> { where(state: :active) }
package com.example.notifications;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import java.io.IOException;
Rails.application.routes.draw do
resources :articles do
resources :comments, shallow: true, only: %i[index new create show edit update destroy]
end
root "articles#index"
import base64
import json
from django.core.exceptions import BadRequest
import io
import os
from uuid import uuid4
from PIL import Image, UnidentifiedImageError
ALLOWED_FORMATS = {"JPEG", "PNG", "WEBP"}