import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
// rawBody: true preserves the exact bytes Stripe signed
const app = await NestFactory.create(AppModule, { rawBody: true });
class Cart < ApplicationRecord
TTL = 30.minutes
has_many :line_items, dependent: :destroy
enum status: { active: 0, expired: 1, checked_out: 2 }
import type { Redis } from "ioredis";
export interface StoredResponse {
status: "pending" | "completed";
fingerprint: string;
httpStatus?: number;
module Keysettable
extend ActiveSupport::Concern
included do
scope :keyset_page, ->(after: nil, limit: 20) do
relation = order(created_at: :asc, id: :asc).limit(limit + 1)
<?php
namespace App\Http\Controllers;
use App\Jobs\SendNewsletterChunk;
use App\Models\NewsletterSend;
package metrics
import "time"
type bucket struct {
start time.Time
package com.example.audit.config;
import java.util.Optional;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;
use axum::extract::ws::{Message, WebSocket, WebSocketUpgrade};
use axum::extract::State;
use axum::response::Response;
use axum::routing::get;
use axum::Router;
import { Injectable, NgZone } from '@angular/core';
import { Observable, Subject } from 'rxjs';
export interface ObserverOptions {
rootMargin?: string;
threshold?: number | number[];
import base64
import json
from datetime import datetime
class InvalidCursor(Exception):
export interface CartItem {
sku: string;
name: string;
unitPrice: number; // cents
qty: number;
}
export interface AnalyticsEvent {
name: string;
props?: Record<string, unknown>;
ts: number;
}