module StatementTimeout
extend ActiveSupport::Concern
class TimeoutExceeded < StandardError; end
def with_statement_timeout(milliseconds)
{% load cache %}
<section class="dashboard">
<h1>{{ team.name }} — Overview</h1>
{% cache 3600 team_order_stats team.id stats_version %}
<div class="stat-grid">
/* Basic transitions */
.button {
background-color: blue;
color: white;
padding: 1rem 2rem;
transition: background-color 0.3s ease;
package com.example.caching.config;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.ShallowEtagHeaderFilter;
import asyncio
import time
from dataclasses import dataclass
from typing import Any, Dict
package com.example.feed;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.util.Base64;
# Gemfile
group :development do
gem 'rack-mini-profiler'
gem 'memory_profiler'
gem 'stackprof' # For flamegraphs
gem 'bullet' # N+1 detection
from blog.models import Post
# Load only specific fields
posts = Post.objects.only('id', 'title', 'published_at')
for post in posts:
import { useEffect, useState } from "react";
export function useDebouncedValue(value, delay = 300) {
const [debounced, setDebounced] = useState(value);
useEffect(() => {
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class CounterFlushJob
include Sidekiq::Job
sidekiq_options queue: :counters, retry: 3
def perform
CounterBuffer.flush_all.each do |field, delta|
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'mydb',
'USER': 'myuser',
'PASSWORD': 'mypassword',