export interface Post {
id: string;
title: string;
updatedAt: string;
}
package com.example.cache;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CompletionException;
import java.util.concurrent.atomic.AtomicBoolean;
class RevenueStat
DEFAULT_RANGE = 30.days
def initialize(account, range: DEFAULT_RANGE)
@account = account
@range = range
<?php
namespace App\Feature;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Contracts\Service\ResetInterface;
package com.example.fx.config;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.caffeine.CaffeineCacheManager;
{% load cache %}
<section class="dashboard">
<h1>{{ team.name }} — Overview</h1>
{% cache 3600 team_order_stats team.id stats_version %}
<div class="stat-grid">
import asyncio
import time
from dataclasses import dataclass
from typing import Any, Dict
class ActivityPanelController < ApplicationController
def show
@project = Project.find(params[:project_id])
@events = @project.events.order(created_at: :desc).limit(50)
latest = @events.maximum(:updated_at)
name: CI
on:
push:
branches: [main]
pull_request:
from django.db import models
from django.db.models import Avg, Count, Sum, DecimalField
from django.db.models.functions import Coalesce, TruncDate
from django.utils import timezone
from django.core.cache import cache
from django.views.decorators.cache import cache_page
from django.utils.decorators import method_decorator
from django.views.generic import ListView, DetailView
from .models import Post
class Cart < ApplicationRecord
TTL = 30.minutes
has_many :line_items, dependent: :destroy
enum status: { active: 0, expired: 1, checked_out: 2 }