from enum import Enum
from typing import Optional
from fastapi import Query
from pydantic import BaseModel, Field, field_validator
class CounterFlushJob
include Sidekiq::Job
sidekiq_options queue: :counters, retry: 3
def perform
CounterBuffer.flush_all.each do |field, delta|
package httpstream
import (
"bufio"
"database/sql"
"fmt"
import { Exclude, Expose } from 'class-transformer';
export class User {
id: string;
firstName: string;
@RestController
@RequestMapping("/users")
public class UserPatchController {
private final UserRepository users;
private final JsonPatchService patchService;
function parseRange(header, size) {
if (!header || !header.startsWith('bytes=')) return null;
const [rawStart, rawEnd] = header.replace('bytes=', '').split('-');
let start;
let end;
import time
from collections import namedtuple
from sqlalchemy import text
CheckResult = namedtuple("CheckResult", ["name", "healthy", "latency_ms", "detail"])
require "sinatra/base"
require "rack/utils"
class AdminApp < Sinatra::Base
before do
protected!
package com.shop.payments.messaging;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public record PaymentEvent(
#[derive(Debug, Clone)]
pub struct Order {
pub id: u64,
pub amount_cents: i64,
pub currency: [u8; 3],
}
package metrics
import "time"
type bucket struct {
start time.Time
export interface CartItem {
sku: string;
name: string;
unitPrice: number; // cents
qty: number;
}