debugging

go
package debughttp

import (
  "context"
  "crypto/tls"
  "net/http"

HTTPtrace to debug DNS/connect/TLS timing in production-like runs

go http client
by Leah Thompson 1 tab
ruby
class JsonLogFormatter < ActiveSupport::Logger::SimpleFormatter
  def call(severity, timestamp, _progname, message)
    if message.is_a?(Hash)
      entry = {
        ts: timestamp.utc.iso8601(3),
        level: severity

Lograge-Style JSON Logging Without Extra Gems

rails logging observability
by codesnips 3 tabs
sql
-- Basic query debugging with EXPLAIN
EXPLAIN SELECT * FROM users WHERE email = 'test@example.com';

-- Output shows query plan:
-- Seq Scan on users (cost=0.00..25.00 rows=1 width=100)
--   Filter: (email = 'test@example.com'::text)

Query debugging and troubleshooting techniques

postgresql debugging troubleshooting
by Maria Garcia 2 tabs
swift
import Foundation
import UIKit

// MARK: - Memory Leak Prevention
class ImageDownloader {
    private var tasks: [URL: URLSessionDataTask] = [:]

Instruments and performance profiling

ios performance profiling
by Sofia Martinez 1 tab
python
# Debug Toolbar setup
INSTALLED_APPS += ['debug_toolbar']

MIDDLEWARE = [
    'debug_toolbar.middleware.DebugToolbarMiddleware',
] + MIDDLEWARE

Django debug toolbar for development

django python debugging
by Priya Sharma 1 tab
bash
# Install
cargo install cargo-expand

# Expand entire crate
cargo expand

cargo-expand to inspect macro expansions

rust macros debugging
by Marcus Chen 1 tab
javascript
// Basic try-catch
try {
  const result = riskyOperation();
  console.log('Success:', result);
} catch (error) {
  console.error('Error occurred:', error.message);

Error handling and debugging techniques in JavaScript

javascript debugging error-handling
by Alex Chang 1 tab
ruby
module QueryBudget
  class Counter
    IGNORED = %w[SCHEMA CACHE TRANSACTION].freeze

    attr_reader :count

Per-Request Query Budget (Detect Runaway Pages)

rails performance observability
by codesnips 4 tabs
ruby
class ApplicationError < StandardError
  attr_reader :context

  class << self
    def context_keys(*keys)
      @context_keys = keys unless keys.empty?

Structured Exceptions with Context

rails observability exceptions
by codesnips 3 tabs