Discover and search community code snippets.
radio
Get gemome wide SNPs, using a reference data and NGS data.
claude test
# MacOS SnipperApp 3 - Claude Code Instructions This file is automatically loaded by Claude Code on every session. All project memory and coding rules live in `.ai/`.
A frosted glass card effect using backdrop-filter.
.glass-card { background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
Properly clean up side effects in React hooks to prevent memory leaks.
import { useEffect, useRef } from "react"; export function useInterval(callback: () => void, delay: number | null) { const savedCallback = useRef(callback);
A simple result builder for generating HTML strings.
@resultBuilder struct HTMLBuilder { static func buildBlock(_ components: String...) -> String { components.joined(separator: "\n")
A concurrent worker pool using goroutines and channels.
package main import ( "fmt"
A decorator that retries a function call with exponential backoff.
import time import functools from typing import Callable, TypeVar
Convert dataclasses to and from JSON with type safety.
from dataclasses import dataclass, asdict import json from typing import Optional
A robust bash script template with error handling.
#!/usr/bin/env bash set -euo pipefail IFS=$'\n\t'
A custom React hook for debouncing values.
import { useEffect, useState } from "react"; export function useDebounce<T>(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState(value);
Modern async/await pattern for making network requests in Swift.
func fetchData<T: Decodable>(from url: URL) async throws -> T { let (data, response) = try await URLSession.shared.data(from: url) guard let httpResponse = response as? HTTPURLResponse,
Define custom error types with the thiserror crate pattern.
use std::fmt; #[derive(Debug)] pub enum AppError {