module RequestStore
def self.store
Thread.current[:request_store] ||= {}
end
def self.fetch(key)
package api
import "net/http"
func ETag(w http.ResponseWriter, r *http.Request, etag string) bool {
w.Header().Set("ETag", etag)
class CounterBuffer
DELTA_HASH = "counter:deltas".freeze
READ_RESET = <<~LUA.freeze
local v = redis.call('HGET', KEYS[1], ARGV[1])
if v then redis.call('HDEL', KEYS[1], ARGV[1]) end
import { useEffect, useState } from "react";
export function useDebouncedValue<T>(value: T, delay = 300): T {
const [debounced, setDebounced] = useState<T>(value);
useEffect(() => {
import hashlib
import json
def compute_etag(payload, weak=False):
body = json.dumps(payload, sort_keys=True, separators=(",", ":"))
require 'activerecord-import'
class BulkImportPostsService
BATCH_SIZE = 1000
def initialize(csv_file_path)
package pipeline
import (
"bufio"
"errors"
"io"
package observability
import (
"time"
"go.uber.org/zap"
package pricecache
import (
"context"
"sync"
module QueryBudget
class Counter
IGNORED = %w[SCHEMA CACHE TRANSACTION].freeze
attr_reader :count
CREATE TABLE events (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
source text NOT NULL,
external_id text NOT NULL,
payload jsonb NOT NULL,
occurred_at timestamptz NOT NULL,
import { useState } from 'react'
import { useQuery } from '@tanstack/react-query'
import { useDebounce } from '@/hooks/useDebounce'
import api from '@/services/api'
export function SearchInput() {