<?php
namespace App\Exports;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Carbon;
module KeysetPaginatable
extend ActiveSupport::Concern
class_methods do
def keyset_page(cursor: nil, limit: 20, direction: :desc)
limit = limit.to_i.clamp(1, 100)
use std::collections::HashMap;
use std::hash::Hash;
use std::sync::{Arc, RwLock};
pub struct Memoizer<K, V> {
store: RwLock<HashMap<K, Arc<V>>>,
import { useState, useEffect, useCallback } from 'react';
export function useLocalStorage(key, initialValue) {
const readValue = useCallback(() => {
if (typeof window === 'undefined') return initialValue;
try {
package com.example.orders;
public final class Order {
public static final Order POISON_PILL = new Order(-1L, 0.0);
export interface Cursor {
createdAt: string;
id: string;
}
export function encodeCursor(c: Cursor): string {
package ratelimit
import (
"sync"
"time"
)
import asyncio
import time
from dataclasses import dataclass, field
@dataclass
import abc
from typing import IO
class Exporter(abc.ABC):
name: str = ""
package com.shop.orders.events;
import java.math.BigDecimal;
import java.time.Instant;
public final class OrderPlaced {
import { Injectable } from '@nestjs/common';
export interface RateLimitResult {
allowed: boolean;
remaining: number;
limit: number;
export interface Todo {
id: string;
title: string;
done: boolean;
}