Skip to content

Code Snippets

779 reusable code snippets across 81 languages — copy and paste practical examples for sorting, array methods, async patterns, and common programming tasks.

Sort Dictionary by Value

Python

Sort a Python dictionary by its values in descending order.

#dict#sorting#intermediate

Array Map Filter Reduce

JavaScript

Chain map, filter, reduce, find, some, and every on arrays.

#array#functional#intermediate

Struct with Methods

Rust

Define a Rust struct and implement methods with self and Self.

#struct#method#intermediate

String Operations and StringBuilder

Java

Manipulate strings with split, join, substring, and StringBuilder in Java.

#string#beginner

SELECT with WHERE and ORDER BY

SQL

Filter, sort, and limit rows with SELECT, WHERE, and ORDER BY in SQL.

#select#query#beginner

Accessible Form with Inputs

HTML

Build an accessible HTML form with labels, inputs, select, and checkbox.

#form#input#beginner

Table with Thead Tbody Tfoot

HTML

Structure tabular data with thead, tbody, tfoot, and caption in HTML.

#table#beginner

Responsive Images and Video

HTML

Embed responsive images with srcset, video, audio, and figure in HTML.

#media#image#intermediate

Links Anchors and Download

HTML

Create internal, external, anchor, email, phone, and download links in HTML.

#link#navigation#beginner

Center a Div with Flexbox and Grid

CSS

Center elements horizontally and vertically using Flexbox, Grid, and absolute positioning.

#center#layout#beginner

CSS Selectors and Pseudo-classes

CSS

Target elements with pseudo-classes, pseudo-elements, and attribute selectors.

#selector#pseudo#intermediate

Controlled Form with Validation

React

Build a controlled React form with inline validation and error messages.

#form#validation#intermediate

Event Handling and List Rendering

React

Handle events and render dynamic lists with keys in React.

#event#list#intermediate

Manage Remotes and Push Pull

Git

Add, change, and interact with remote repositories in Git.

#remote#push#intermediate

View Commit History with git log

Git

Browse, filter, and format commit history with git log options.

#log#history#beginner

Variables and Arrays in Bash

Bash

Assign variables, use command substitution, and work with arrays in Bash.

#variable#array#beginner

Arrays and Array Functions in PHP

PHP

Create indexed, associative, and multidimensional arrays with map and filter.

#array#beginner

String Functions in PHP

PHP

Manipulate strings with substr, replace, explode, and sprintf in PHP.

#string#beginner

Read and Write Files in PHP

PHP

Read, write, append, and iterate files with PHP filesystem functions.

#file#io#intermediate

PDO Database Queries in PHP

PHP

Connect and run prepared statements safely with PDO in PHP.

#pdo#database#intermediate

Sessions and Cookies in PHP

PHP

Store user data across requests with sessions and cookies in PHP.

#session#cookie#intermediate

Classes and Inheritance in PHP

PHP

Define classes with constructors, visibility, and inheritance in PHP.

#class#oop#intermediate

Array Deduplication

JavaScript

Deduplicate an array using Set.

#array#set#dedup

Deep Clone

JavaScript

Deep clone objects, supporting common data types.

#object#clone#recursion

Debounce Function

JavaScript

Wait a period of time after an event triggers before executing; reset the timer if triggered again during the wait.

#function#performance#debounce

Throttle Function

JavaScript

Limit a function to execute at most once within a time interval.

#function#performance#throttle

Promise.all Concurrency Control

JavaScript

A Promise executor with concurrency limit.

#promise#concurrency#async

async/await Error Handling

JavaScript

Wrap async functions to uniformly catch exceptions.

#async#error#wrapper

Fetch Wrapper

JavaScript

Wrap fetch with timeout, error handling, and JSON parsing.

#fetch#http#wrapper

localStorage Operations

JavaScript

Wrap localStorage with expiration time and JSON support.

#storage#local-storage

Cookie Operations

JavaScript

Wrap Cookie read, write, and delete operations.

#cookie#browser

URL Parameter Parsing

JavaScript

Parse URL query string into an object.

#url#parse

Date Formatting

JavaScript

Format a date into a specified string.

#date#format

Money Formatting

JavaScript

Format a number as a thousands-separated money string.

#number#format#currency

Random Number Generation

JavaScript

Generate random numbers and random strings within a range.

#random#random

Color Conversion

JavaScript

Convert between RGB and HEX colors.

#color#conversion

UUID Generation

JavaScript

Generate a unique identifier compliant with UUID v4.

#uuid#unique-id

String Truncation

JavaScript

Truncate a string and append an ellipsis.

#string#truncate

Array Flattening

JavaScript

Flatten a multi-dimensional array into one dimension.

#array#flatten

Object Merging

JavaScript

Deeply merge multiple objects.

#object#merge

Type Checking

JavaScript

Precisely determine JavaScript data types.

#type#check

Event Delegation

JavaScript

Implement event delegation via event bubbling.

#event#DOM#performance

DOM Manipulation

JavaScript

Dynamically create and manipulate DOM elements.

#dom#create

Form Validation

JavaScript

A collection of common form validation rules.

#form#validation#regex

File Upload

JavaScript

Wrap file upload with progress and chunking support.

#file#upload#FormData

Image Lazy Loading

JavaScript

Implement image lazy loading with IntersectionObserver.

#image#lazy-load#IntersectionObserver

Copy to Clipboard

JavaScript

A cross-browser clipboard copy method.

#clipboard#copy

Fullscreen API

JavaScript

Wrap browser fullscreen operations.

#fullscreen#fullscreen

Geolocation

JavaScript

Get user geolocation information.

#geolocation#geolocation

Web Worker

JavaScript

Create a Web Worker to run time-consuming tasks.

#worker#multithreading

Service Worker

JavaScript

Register a Service Worker for offline caching.

#service-worker#pwa#cache

IndexedDB Operations

JavaScript

Wrap IndexedDB CRUD operations.

#indexeddb#database#storage

Canvas Drawing

JavaScript

Basic Canvas drawing example.

#canvas#drawing

List Comprehension

Python

Quickly generate lists using list comprehensions.

#list#comprehension

Dictionary Merging

Python

Multiple ways to merge dictionaries.

#dict#merge

File Read/Write

Python

Various ways to read and write files.

#file#io

CSV Processing

Python

Read and write CSV files using the csv module.

#csv#file

JSON Processing

Python

JSON serialization and deserialization.

#json#serialize

Regex Matching

Python

Perform regex matching using the re module.

#regex#regex

Date Handling

Python

Handle dates and times with datetime.

#datetime#date

Decorators

Python

Define and use decorators.

#decorator#decorator

Generators

Python

Save memory using generators.

#generator#generator

Context Manager

Python

Custom context managers.

#context#with

Exception Handling

Python

Complete exception handling mechanism.

#exception#error

Class Inheritance

Python

Class inheritance and method overriding.

#class#inheritance#oop

Multithreading

Python

Implement multithreading using the threading module.

#threading#multithreading

Multiprocessing

Python

Achieve true parallelism with multiprocessing.

#multiprocessing#multi-process

asyncio Asynchronous Programming

Python

Implement asynchronous concurrency with asyncio.

#asyncio#async

Socket Programming

Python

TCP Socket server and client.

#socket#network

HTTP Requests

Python

Send HTTP requests using the requests library.

#http#requests

Database Operations

Python

Operate on databases using sqlite3.

#database#sqlite

Virtual Environment

Python

Create and manage Python virtual environments.

#venv#environment

pip Install

Python

Common pip package management commands.

#pip#package-manager

Environment Variables

Python

Read and set environment variables.

#env#env-vars

Logging

Python

Configure and use the logging module.

#logging#logging

Unit Testing

Python

Write unit tests using unittest.

#test#unittest

Type Hints

Python

Improve code readability with type annotations.

#typing#type

Dataclass

Python

Simplify class definitions with dataclass.

#dataclass#class

Enum

Python

Define enum types using Enum.

#enum#enum

Property Decorator

Python

Control attribute access with property.

#property#property

Magic Methods

Python

Common magic method examples.

#magic#dunder

Iterator

Python

Custom iterator implementation.

#iterator#iterator

Coroutine

Python

Basic usage of coroutines.

#coroutine#coroutine

Generic Functions

TypeScript

Define and use generic functions.

#generic#function

Conditional Types

TypeScript

Select types based on conditions.

#conditional-type#advanced-type

Mapped Types

TypeScript

Construct new types from existing ones.

#mapped-type#advanced-type

Utility Types

TypeScript

TypeScript built-in utility types.

#utility-type#utility

Type Guards

TypeScript

Custom type guard functions.

#type-guard#type-narrowing

Function Overloads

TypeScript

Define function overload signatures.

#overload#function

Decorators

TypeScript

Class and method decorators.

#decorator#decorator

Enum

TypeScript

Numeric, string, and const enums.

#enum#enum

Interface Inheritance

TypeScript

Interface inheritance and implementation.

#interface#inheritance

Abstract Classes

TypeScript

Define abstract classes and abstract methods.

#abstract#class

Namespaces

TypeScript

Organize code using namespaces.

#namespace#namespace

Module Declarations

TypeScript

Write type declarations for JS libraries.

#declaration#module

Declaration Merging

TypeScript

Merge multiple declarations with the same name.

#merge#declaration

Optional Chaining

TypeScript

Safely access deep properties.

#optional-chaining#optional

Nullish Coalescing

TypeScript

Use a default value only for null/undefined.

#nullish-coalescing#nullish

Type Inference

TypeScript

TypeScript automatically infers types.

#inference#inference

const Assertions

TypeScript

Narrow types using as const.

#const#assertion

satisfies Operator

TypeScript

Type-check while preserving the narrowest type.

#satisfies#type

infer Keyword

TypeScript

Extract types within conditional types.

#infer#conditional-type

Template Literal Types

TypeScript

Construct types based on strings.

#template-literal#type

goroutine

Go

Implement concurrency using goroutines.

#goroutine#concurrency

channel

Go

Communicate between goroutines using channels.

#channel#communication

select

Go

Multiplex channels using select.

#select#channel

mutex Mutex

Go

Protect shared data using sync.Mutex.

#mutex#concurrency

defer Deferred Call

Go

Usage and execution order of defer.

#defer#resource-release

error Handling

Go

Go's error handling pattern.

#error#error-handling

interface

Go

Define and implement interfaces.

#interface#interface

Struct Embedding

Go

Implement composition via embedding.

#struct#embedding

Generics

Go

Using generics in Go 1.18+.

#generic#generics

context

Go

Control timeout and cancellation using context.

#context#timeout

File Operations

Go

Read and write file operations.

#file#io

HTTP Server

Go

Create an HTTP server.

#http#server

HTTP Client

Go

Send HTTP requests.

#http#client

JSON Encoding/Decoding

Go

Convert between structs and JSON.

#json#serialize

String Processing

Go

Common operations in the strings package.

#strings#string

Slice Operations

Go

Common slice operations.

#slice#slice

map Operations

Go

CRUD operations on map.

#map#dict

Time Handling

Go

Common operations in the time package.

#time#time

Regular Expressions

Go

Using the regexp package.

#regex#regex

Testing

Go

Write unit tests.

#test#test

Stream API

Java

Process collections using the Stream API.

#stream#collection#functional

Lambda Expressions

Java

Simplify code with Lambda expressions.

#lambda#functional

Optional

Java

Handle null values elegantly.

#optional#nullish

Collection Operations

Java

Common operations on List, Set, and Map.

#collections#collection

Exception Handling

Java

try-catch-finally and custom exceptions.

#exception#exception

File IO

Java

Read and write file operations.

#io#file

Threads

Java

Create and manage threads.

#thread#multithreading

Concurrency Utilities

Java

Common utilities in the concurrency package.

#concurrent#concurrency

Annotations

Java

Custom annotations and usage.

#annotation#annotation

Generics

Java

Generic classes and methods.

#generics#generic

Reflection

Java

Get class information at runtime.

#reflection#reflection

Serialization

Java

Object serialization and deserialization.

#serialization#serialize

Date and Time

Java

Java 8+ Date-Time API.

#datetime#date

Regular Expressions

Java

Pattern and Matcher.

#regex#regex

JDBC

Java

Database connection and operations.

#jdbc#database

HTTP Client

Java

Java 11+ HTTP client.

#http#network

Record

Java

Java 14+ record classes.

#record#data-class

Pattern Matching

Java

instanceof pattern matching.

#pattern-matching#type

Sealed Classes

Java

Java 17+ sealed classes.

#sealed#inheritance

Text Blocks

Java

Java 15+ multi-line strings.

#text-block#string

JOIN Queries

SQL

Multi-table join queries.

#join#Query

Subqueries

SQL

Nested queries.

#subquery#Query

Window Functions

SQL

Ranking and aggregate window functions.

#window#function

Aggregate Functions

SQL

GROUP BY and HAVING.

#aggregate#aggregation

CTE

SQL

Common Table Expressions.

#cte#with

Recursive Queries

SQL

Query hierarchical data with recursive CTE.

#recursive#cte

Indexes

SQL

Create and manage indexes.

#index#performance

Transactions

SQL

Transaction control and isolation levels.

#transaction#transaction

Stored Procedures

SQL

Create stored procedures and functions.

#procedure#function

Triggers

SQL

Automatically executing triggers.

#trigger#trigger

Views

SQL

Create and manage views.

#view#view

Materialized Views

SQL

Materialized views and refresh.

#materialized-view#performance

Partitioned Tables

SQL

Table partitioning strategies.

#partition#partition

Backup and Recovery

SQL

Data backup, import, and export.

#backup#recovery

Performance Optimization

SQL

Query performance analysis and optimization.

#performance#optimization

JSON Operations

SQL

PostgreSQL JSON/JSONB operations.

#json#jsonb

Full-Text Search

SQL

PostgreSQL full-text search.

#fulltext#search

Pivot/Unpivot

SQL

PIVOT and Crosstab.

#pivot#conversion

Date Queries

SQL

Date and time operations.

#date#time

Pagination Queries

SQL

LIMIT/OFFSET and cursor pagination.

#pagination#pagination

Ownership

Rust

Rust ownership system.

#ownership#ownership

Borrowing and References

Rust

References and mutable borrows.

#borrow#reference

Lifetimes

Rust

Explicit lifetime annotations.

#lifetime#lifetime

Trait

Rust

Define and implement traits.

#trait#interface

Generics

Rust

Generic functions and structs.

#generics#generic

Enum

Rust

Enums and Option.

#enum#enum

Pattern Matching

Rust

match and destructuring.

#match#pattern-matching

Error Handling

Rust

Result and the ? operator.

#error#error-handling

Iterator

Rust

Iterator adapters and consumers.

#iterator#iterator

Closures

Rust

Closures and Fn traits.

#closure#closure

Module System

Rust

Modules, paths, and visibility.

#module#module

Concurrent Programming

Rust

Threads and channels.

#concurrency#concurrency

Smart Pointers

Rust

Box, Rc, RefCell.

#pointer#smart-pointer

Macros

Rust

Declarative and procedural macros.

#macro#macro

Unsafe Rust

Rust

Unsafe operations.

#unsafe#unsafe

Smart Pointers

C++

unique_ptr, shared_ptr, weak_ptr.

#smart-pointer#memory

RAII

C++

Resource Acquisition Is Initialization.

#raii#resource-management

Move Semantics

C++

Rvalue references and move constructors.

#move#move-semantics

Lambda Expressions

C++

Lambda and captures.

#lambda#functional

Templates

C++

Function templates and class templates.

#template#generic

STL Containers

C++

Common container operations.

#stl#container

STL Algorithms

C++

Common algorithm functions.

#algorithm#algorithm

Iterator

C++

Iterator types and usage.

#iterator#iterator

Exception Handling

C++

try-catch and custom exceptions.

#exception#exception

Multithreading

C++

thread, mutex, condition_variable.

#thread#multithreading

File IO

C++

File read and write operations.

#io#file

Strings

C++

std::string operations.

#string#string

Regular Expressions

C++

std::regex matching and replacement.

#regex#regex

Type Deduction

C++

auto, decltype, template deduction.

#auto#type-inference

constexpr

C++

Compile-time constants and computation.

#constexpr#compile-time

Semantic Tags

HTML

HTML5 semantic structure.

#html#semantic

Form Validation

HTML

HTML5 form validation.

#html#form

CSS Grid

CSS

Grid layout.

#css#grid

Flexbox

CSS

Flexible box layout.

#css#flexbox

Animation

CSS

CSS keyframe animations.

#css#animation

Transitions

CSS

CSS transition effects.

#css#transition

CSS Variables

CSS

Custom properties.

#css#variables

Media Queries

CSS

Responsive breakpoints.

#css#media-query

Pseudo-classes and Pseudo-elements

CSS

Pseudo-classes and pseudo-elements.

#css#pseudo

Responsive Design

CSS

Responsive layout techniques.

#css#responsive

Dark Mode

CSS

Dark theme switching.

#css#dark-mode

Custom Scrollbar

CSS

Style scrollbars.

#css#scrollbar

Gradients

CSS

Linear and radial gradients.

#css#gradient

Shadow Effects

CSS

box-shadow and text-shadow.

#css#shadow

Filters

CSS

CSS filter effects.

#css#filter

Transforms

CSS

2D/3D transforms.

#css#transform

SVG

HTML

Scalable Vector Graphics.

#svg#graphics

Canvas

HTML

Canvas drawing.

#canvas#graphics

Web Components

HTML

Custom elements and Shadow DOM.

#web-components#component

Accessibility

HTML

ARIA and accessibility.

#a11y#accessibility

useState

React

State management Hook.

#react#hook

useEffect

React

Side-effect Hook.

#react#hook

useContext

React

Shared state via context.

#react#hook

useReducer

React

Complex state management.

#react#hook

useMemo

React

Memoize computation results.

#react#hook

useCallback

React

Memoize callback functions.

#react#hook

useRef

React

Reference DOM and mutable values.

#react#hook

Custom Hooks

React

Extract reusable logic.

#react#hook

Component Communication

React

Parent-child and sibling component communication.

#react#communication

Error Boundaries

React

Catch component errors.

#react#error

Lazy Loading

React

Code splitting and lazy loading.

#react#lazy

Portal

React

Render to DOM nodes outside the component.

#react#portal

Higher-Order Components

React

Component enhancement pattern.

#react#hoc

Render Props

React

Render props pattern.

#react#render-props

Performance Optimization

React

React performance optimization tips.

#react#performance

File Operations

Bash

File and directory management.

#bash#file

Text Processing

Bash

Text processing with grep, sed, awk.

#bash#text

Loops

Bash

for and while loops.

#bash#loop

Conditionals

Bash

if and case conditional statements.

#bash#conditional

Functions

Bash

Function definition and parameters.

#bash#function

Arrays

Bash

Bash array operations.

#bash#array

String Operations

Bash

Bash string processing.

#bash#string

Git Basics

Bash

Basic Git operations.

#git#basic

Git Branches

Bash

Branch management and operations.

#git#branch

Git Merge

Bash

Merging and conflict resolution.

#git#merge

Git Revert

Bash

Undo commits and revert.

#git#rollback

Git Tags

Bash

Version tag management.

#git#tag

Git Stash

Bash

Stash working directory changes.

#git#stash

Git Cherry-pick

Bash

Selectively merge commits.

#git#cherry-pick

Git Bisect

Bash

Binary search to locate problem commits.

#git#bisect

Draggable

jQuery UI

Make elements draggable with axis, containment, and event callbacks.

#draggable#interaction#ui

Droppable

jQuery UI

Create drop targets that accept draggable elements with hover and drop events.

#droppable#interaction#ui

Resizable

jQuery UI

Add resize handles with min/max constraints and aspect ratio lock.

#resizable#interaction#ui

Sortable

jQuery UI

Reorder list items via drag-and-drop and persist the new order.

#sortable#interaction#ui

Accordion

jQuery UI

Collapsible content panels with only one section expanded at a time.

#accordion#widget#ui

Datepicker

jQuery UI

Calendar widget with date range limits, formatting, and inline mode.

#datepicker#widget#ui

Dialog

jQuery UI

Modal window with buttons, animations, and dynamic open/close.

#dialog#widget#ui

Tabs

jQuery UI

Tabbed content panels with AJAX loading and event-driven switching.

#tabs#widget#ui

Page Structure

jQuery Mobile

Multi-page template with header, content, and footer roles.

#page#structure#layout

Page Transitions

jQuery Mobile

Apply slide, pop, flip, and fade transitions between pages.

#transitions#animation#navigation

Toolbars

jQuery Mobile

Fixed header and footer bars with fullscreen tap-to-toggle mode.

#header#footer#toolbars

Navbars

jQuery Mobile

Persistent icon-based navigation bars in the footer.

#navbar#navigation#footer

Listviews

jQuery Mobile

Filterable, grouped lists with thumbnails, icons, and count bubbles.

#listview#list#data

Forms

jQuery Mobile

Enhanced inputs including sliders, switches, and grouped controls.

#forms#input#controls

Buttons

jQuery Mobile

Themed, iconified, and grouped buttons from links and inputs.

#button#ui#controls

Popup

jQuery Mobile

Modal popups, dialogs, and tooltips with positioning control.

#popup#modal#overlay

Bar Chart

Chart.js

Vertical bar chart with custom colors and rounded corners.

#chart#bar

Line Chart

Chart.js

Smooth line chart with fill, tension, and hover styling.

#chart#line

Pie Chart

Chart.js

Pie chart with per-slice colors and legend positioning.

#chart#pie

Doughnut Chart

Chart.js

Doughnut chart with cutout control and centered title.

#chart#doughnut

Radar Chart

Chart.js

Multi-series radar chart for comparing entities across dimensions.

#chart#radar

Responsive Chart

Chart.js

Chart that fills its container with maintainAspectRatio disabled.

#chart#responsive

Options Configuration

Chart.js

Title, legend, axis formatting, animations, and live updates.

#chart#options#config

Tooltips

Chart.js

Custom-styled tooltips with title, label, and footer callbacks.

#chart#tooltips

Bar Chart

ECharts

Category bar chart with axis tooltip and styled bars.

#echarts#bar

Line Chart

ECharts

Smooth multi-series line chart with area fill.

#echarts#line

Pie Chart

ECharts

Donut-style pie with emphasis effect and percentage labels.

#echarts#pie

Scatter Plot

ECharts

Scatter plot with point size encoded by a third dimension.

#echarts#scatter

Radar Chart

ECharts

Radar with multiple indicators and overlaid value series.

#echarts#radar

Options & Series

ECharts

Dataset-driven multi-series chart with grid and legend config.

#echarts#options#dataset

Tooltip

ECharts

Custom HTML tooltip with crosshair axis pointer.

#echarts#tooltip

Responsive

ECharts

Resize chart on window and container changes, with cleanup.

#echarts#responsive

Module & Controller

AngularJS

Define a module and a controller with scope methods.

#angularjs#module#controller

Scope Inheritance

AngularJS

Prototypal scope inheritance between parent and child controllers.

#angularjs#scope#inheritance

Custom Directives

AngularJS

Attribute directive and element directive with isolated scope.

#angularjs#directive#reusable

Services & Factories

AngularJS

Factory and service singletons for shared state and logic.

#angularjs#service#factory

Routing (ngRoute)

AngularJS

Configure routes with templates, controllers, and resolve guards.

#angularjs#routing#ngRoute

Custom Filters

AngularJS

Chainable filters for formatting values in templates.

#angularjs#filter#formatting

Forms & Validation

AngularJS

Form with required, minlength, email validation, and disabled submit.

#angularjs#form#validation

$http Service

AngularJS

Promise-based HTTP requests with config object and error handling.

#angularjs#http#ajax

Component Basics

Angular

Define an Angular component with selector, template, and styles.

#component#basics

Template Syntax & Binding

Angular

Interpolation, property, event, and two-way binding in Angular templates.

#template#binding

Built-in Directives

Angular

Use *ngIf, *ngFor, ngClass, and ngStyle to shape the DOM.

#directives#ngIf#ngFor

Pipes & Custom Pipe

Angular

Transform template values with built-in and custom pipes.

#pipes#transform

Services & Dependency Injection

Angular

Create an injectable service and consume it in a component.

#service#dependency-injection

Routing Configuration

Angular

Define routes with params, lazy loading, and redirects.

#routing#router

Reactive Forms

Angular

Build a typed reactive form with FormBuilder and validators.

#forms#reactive-forms

HttpClient & RxJS

Angular

Perform typed HTTP requests with HttpClient and Observables.

#http#rxjs

Single-File Component

Vue 3

Define a Vue 3 component with script setup, template, and scoped styles.

#component#sfc#script-setup

Composition API

Vue 3

Organize reactive state, computed, and lifecycle logic by feature.

#composition-api#script-setup

Refs & Reactive

Vue 3

Choose between ref and reactive for reactive state.

#reactivity#ref#reactive

Computed & Watch

Vue 3

Derive values with computed and react to changes with watch.

#computed#watch#reactivity

Props & Emits

Vue 3

Declare inputs and events, and implement v-model on a component.

#props#emits#v-model

Lifecycle Hooks

Vue 3

Register lifecycle callbacks as composable functions.

#lifecycle#hooks

Slots & Scoped Slots

Vue 3

Distribute content with default, named, and scoped slots.

#slots#content-distribution

Composables

Vue 3

Extract reusable reactive logic into a useMouse composable.

#composables#reuse

Selectors

jQuery

Select elements by id, class, attribute, and pseudo-filters.

#selectors#basics

Events & Delegation

jQuery

Bind handlers with on(), support delegation and namespaced removal.

#events#delegation

DOM Manipulation

jQuery

Get/set text, html, attributes, classes, and insert nodes.

#dom#manipulation

AJAX Requests

jQuery

Use $.ajax, $.get, $.post, and load with promises.

#ajax#http

Effects & Animation

jQuery

Show, hide, fade, slide, and animate elements.

#effects#animation

Traversing the DOM

jQuery

Navigate relatives and filter the matched set.

#traversing#navigation

Utility Methods

jQuery

Iterate, merge, and filter with jQuery helpers.

#utilities#helpers

Method Chaining

jQuery

Chain jQuery methods and use end() to restore context.

#chaining#fluent-api

Grid System

Bootstrap

Lay out pages with the 12-column responsive grid.

#grid#layout

Responsive Utilities

Bootstrap

Show, hide, and reorder elements per breakpoint.

#responsive#utilities

Navbar

Bootstrap

Build a responsive collapsing navbar with brand and links.

#navbar#navigation

Cards

Bootstrap

Compose a card with image, body, list, and footer.

#cards#components

Modal

Bootstrap

Trigger and structure a Bootstrap modal dialog.

#modal#components

Forms & Validation

Bootstrap

Build a responsive form with validation feedback.

#forms#validation

Buttons

Bootstrap

Use button variants, sizes, states, and groups.

#buttons#components

Alerts

Bootstrap

Display contextual messages with dismissible alerts.

#alerts#components

Semantic Elements

HTML5

Structure a page with header, nav, main, article, and footer.

#semantic#structure

Form Input Types

HTML5

Use native HTML5 input types, validation, and datalist.

#forms#input-types

Canvas Basics

HTML5

Draw shapes, lines, and text on a 2D canvas.

#canvas#graphics

Video & Audio

HTML5

Embed media with multiple sources and control playback.

#video#audio#media

Local & Session Storage

HTML5

Persist data in the browser with the Web Storage API.

#storage#web-storage

Geolocation

HTML5

Get the user's position and watch for changes.

#geolocation#location

Drag and Drop

HTML5

Accept dropped files with the Drag and Drop API.

#drag-drop#files

Web Workers

HTML5

Run heavy computation on a background thread.

#web-workers#concurrency

Flexbox Layout

CSS3

Align and distribute items along one axis with flexbox.

#flexbox#layout

Grid Layout

CSS3

Build two-dimensional layouts with grid-template-areas.

#grid#layout

Animations

CSS3

Define keyframes and apply reusable animations.

#animations#keyframes

Transitions

CSS3

Smoothly interpolate properties on state change.

#transitions#hover

2D & 3D Transforms

CSS3

Translate, rotate, and scale elements with GPU-friendly transforms.

#transforms#3d

Media Queries

CSS3

Apply responsive, print, and preference-based styles.

#media-queries#responsive

Custom Properties

CSS3

Define and reuse CSS variables with live updates.

#custom-properties#variables

Pseudo-Classes

CSS3

Select elements by state and structural position.

#pseudo-classes#selectors

Variables

Sass

Store colors, spacing, and breakpoints in Sass variables.

#variables#basics

Nesting

Sass

Mirror HTML structure and use the parent selector with &.

#nesting#syntax

Mixins

Sass

Create reusable style groups with arguments and defaults.

#mixins#reuse

Extend & Placeholders

Sass

Share styles across selectors with @extend and %placeholders.

#extend#placeholders

Partials & @use

Sass

Split stylesheets into partials and load them with @use.

#partials#import#use

Functions

Sass

Define custom functions that return computed values.

#functions#logic

Control Directives

Sass

Generate styles with @for, @each, and @if.

#control#loops#conditionals

Operators

Sass

Use arithmetic, relational, and equality operators in Sass.

#operators#math

Utility Classes

Tailwind CSS

Compose a button and card from atomic utilities.

#utilities#basics

Responsive Design

Tailwind CSS

Apply per-breakpoint utilities with sm:, md:, and lg: prefixes.

#responsive#breakpoints

Hover & Focus States

Tailwind CSS

Style interactive states and group-hover with variant prefixes.

#states#hover#focus

Flexbox & Grid

Tailwind CSS

Center, distribute, and grid layouts with utilities.

#flexbox#grid#layout

Colors

Tailwind CSS

Use the default palette, opacity modifiers, and gradients.

#colors#palette

Spacing

Tailwind CSS

Apply padding, margin, gap, and width/height from one scale.

#spacing#padding#margin

Custom Configuration

Tailwind CSS

Extend the theme with custom colors, fonts, and animations.

#config#customization

Dark Mode

Tailwind CSS

Toggle themes with the dark: variant and class strategy.

#dark-mode#theming

Run a Container

Docker

Run, list, stop, and remove Docker containers.

#container#run#basics

Writing a Dockerfile

Docker

Build an image from a Dockerfile with multi-instruction layers.

#dockerfile#build#image

Image Management

Docker

Pull, list, tag, push, and prune images.

#image#registry#maintenance

Volumes & Bind Mounts

Docker

Persist data with named volumes, anonymous volumes, and bind mounts.

#volume#persistence#storage

Networking

Docker

Create networks, attach containers, and expose ports.

#network#bridge#service-discovery

Docker Compose

Docker

Define and run multi-container apps with compose.

#compose#orchestration#yaml

Multi-Stage Build

Docker

Build artifacts in one stage and copy them into a slim final image.

#dockerfile#multi-stage#optimization

Exec & Logs

Docker

Run commands inside running containers and inspect logs.

#exec#logs#debugging

Pod Manifest

Kubernetes

Define a standalone Pod with a container, env, and probe.

#pod#manifest#probe

Deployment & Rollout

Kubernetes

Manage a replicated, rolling-updated workload.

#deployment#rollout#replica

Service Types

Kubernetes

Expose Pods via ClusterIP, NodePort, and LoadBalancer services.

#service#networking#discovery

ConfigMap & Secret

Kubernetes

Inject configuration and sensitive data into containers.

#configmap#secret#configuration

Ingress Routing

Kubernetes

Route external HTTP traffic to services by host and path.

#ingress#routing#tls

Labels & Selectors

Kubernetes

Tag resources and query them with selectors.

#labels#selectors#query

kubectl Basics

Kubernetes

Common kubectl commands for everyday operations.

#kubectl#cli#operations

Namespaces

Kubernetes

Partition a cluster into isolated virtual clusters.

#namespace#isolation#quota

Insert & Find

MongoDB

Insert documents and query a collection.

#insert#find#crud

Query Operators

MongoDB

Use comparison, logical, array, and regex operators.

#query#operators#filter

Aggregation Pipeline

MongoDB

Build multi-stage pipelines for analytics.

#aggregation#pipeline#analytics

Indexes

MongoDB

Create single, compound, and text indexes for performance.

#index#performance#query

Update & Delete

MongoDB

Modify and remove documents with update operators.

#update#delete#crud

Collections & Schema

MongoDB

Manage collections, validators, and capped collections.

#collection#schema#validation

Replica Set

MongoDB

Configure a replica set for high availability.

#replication#replica-set#ha

Sharding

MongoDB

Distribute data across shards by a shard key.

#sharding#scaling#cluster

SELECT with JOINs

MySQL

Combine rows from multiple tables using JOINs.

#select#join#query

Subqueries

MySQL

Use scalar, IN, EXISTS, and derived-table subqueries.

#subquery#query#filter

Indexes

MySQL

Create single, composite, unique, and fulltext indexes.

#index#performance#optimization

Transactions

MySQL

Use BEGIN, COMMIT, ROLLBACK, and isolation levels.

#transaction#acid#locking

Stored Procedures

MySQL

Define reusable procedural routines with parameters.

#procedure#routine#transaction

Triggers

MySQL

Run logic automatically on INSERT, UPDATE, or DELETE.

#trigger#audit#validation

Views

MySQL

Create virtual tables to simplify and secure queries.

#view#abstraction#security

Query Optimization

MySQL

Diagnose and optimize slow queries with EXPLAIN and indexes.

#optimization#performance#explain

SELECT with JOINs

PostgreSQL

Use INNER, LEFT, and LATERAL joins in PostgreSQL.

#select#join#lateral

JSONB Operations

PostgreSQL

Store, query, and index JSONB documents.

#jsonb#document#index

Window Functions

PostgreSQL

Compute rankings, running totals, and moving averages.

#window#analytics#ranking

Common Table Expressions

PostgreSQL

Use CTEs and recursive CTEs for readable queries.

#cte#recursive#readability

Index Types

PostgreSQL

Create B-tree, GIN, GiST, and partial indexes.

#index#performance#partial

Full-Text Search

PostgreSQL

Search text using tsvector, tsquery, and ranking.

#fulltext#search#gin

Transactions & Isolation

PostgreSQL

Control transactions, savepoints, and isolation levels.

#transaction#isolation#savepoint

Array Operations

PostgreSQL

Store and query arrays of scalar values.

#array#datatype#gin

Strings & Counters

Redis

Set, get, increment, and expire string values.

#string#counter#cache

Lists & Queues

Redis

Build queues and stacks with list operations.

#list#queue#stack

Hashes

Redis

Store object fields and values efficiently.

#hash#object#field

Sets

Redis

Manage unique collections and compute intersections.

#set#unique#setops

Sorted Sets & Leaderboards

Redis

Rank items by score for leaderboards and scheduling.

#sorted-set#leaderboard#ranking

Pub/Sub

Redis

Broadcast messages to subscribed clients.

#pubsub#messaging#broadcast

Persistence

Redis

Configure RDB snapshots and AOF append logs.

#persistence#rdb#aof

Keys & Expiration

Redis

Set TTL, scan keys, and inspect the keyspace.

#ttl#expiration#scan

Server Block

Nginx

Configure a virtual host with root, index, and try_files.

#server#static#hosting

Reverse Proxy

Nginx

Forward requests to upstream HTTP services.

#proxy#upstream#websocket

Load Balancing

Nginx

Distribute traffic across multiple upstream servers.

#load-balancing#upstream#ha

HTTPS & SSL

Nginx

Terminate TLS with certificates and HTTP/2.

#ssl#tls#https

Location Rules

Nginx

Match request URIs with prefix, regex, and exact locations.

#location#routing#regex

Rewrite & Redirect

Nginx

Rewrite URIs and issue HTTP redirects.

#rewrite#redirect#url

Gzip Compression

Nginx

Compress text responses to reduce bandwidth.

#gzip#compression#performance

Proxy Caching

Nginx

Cache upstream responses to reduce backend load.

#cache#performance#proxy

File Operations

Linux

Copy, move, link, and search files efficiently.

#file#find#copy

Permissions & Ownership

Linux

Manage read/write/execute bits with chmod and chown.

#permission#chmod#chown

Process Management

Linux

List, signal, and monitor running processes.

#process#kill#signal

Networking

Linux

Inspect interfaces, ports, connections, and DNS.

#network#ip#ports

Package Management

Linux

Install, update, and search packages on Debian and RHEL.

#package#apt#dnf

Text Processing

Linux

Filter, transform, and summarize text streams.

#text#awk#sed

Disk Usage

Linux

Inspect filesystems, large directories, and inodes.

#disk#du#df

Users & Groups

Linux

Create users, manage groups, and grant sudo access.

#user#group#sudo

Create Table

SQLite

Define tables with constraints and autoincrement keys.

#create#table#schema

Insert & Query

SQLite

Insert rows and query with parameterized statements.

#insert#query#crud

JOINs & Aggregates

SQLite

Combine tables and aggregate grouped rows.

#join#group#aggregate

Indexes & EXPLAIN

SQLite

Create indexes and inspect query plans.

#index#explain#performance

Transactions & Savepoints

SQLite

Wrap statements in atomic units with savepoints.

#transaction#savepoint#atomic

PRAGMA Statements

SQLite

Configure SQLite behavior and inspect the database.

#pragma#configuration#wal

ATTACH Database

SQLite

Query across multiple database files in one connection.

#attach#multi-db#migration

Export & Import

SQLite

Dump databases to SQL and restore from dumps.

#export#import#backup

fs Module

Node.js

Read, write, and watch files with promises and callbacks.

#fs#file#stream

HTTP Server

Node.js

Build an HTTP server with the http module and routing.

#http#server#routing

Streams

Node.js

Pipe, transform, and consume streams efficiently.

#stream#transform#pipeline

EventEmitter

Node.js

Emit and listen for custom events.

#events#eventemitter#async

path Module

Node.js

Join, resolve, and parse file paths cross-platform.

#path#filesystem#cross-platform

Buffers

Node.js

Work with binary data using Buffer and TypedArrays.

#buffer#binary#encoding

Child Process

Node.js

Spawn, exec, and fork external processes.

#child-process#spawn#exec

Async Patterns

Node.js

Run promises in parallel, sequentially, and with limits.

#async#promise#concurrency

Model Definition

Django

Define a Django model with field types and meta options.

#model#orm#fields

ORM QuerySet

Django

Filter, exclude, annotate and chain QuerySets.

#orm#queryset#filter

Class-Based Views

Django

Use generic class-based views for common CRUD flows.

#views#cbv#crud

URL Routing

Django

Wire URLs to views with path converters and includes.

#urls#routing

ModelForms

Django

Build forms from models with validation and widgets.

#forms#validation

Template Tags

Django

Use built-in tags and filters in Django templates.

#templates#tags#filters

Admin Customization

Django

Customize the Django admin with list_display and actions.

#admin#customization

Authentication

Django

Login, logout, and protect views with auth decorators.

#auth#login#decorators

Routing

Flask

Define routes with methods and dynamic parameters.

#routing#methods

Request and Response

Flask

Access request data and build custom responses.

#request#response#json

Jinja2 Templates

Flask

Render templates with context and template inheritance.

#templates#jinja2

Blueprints

Flask

Organize an app into modular blueprints.

#blueprints#structure

Session

Flask

Store per-user data in signed session cookies.

#session#cookies

Error Handling

Flask

Register custom error handlers for HTTP exceptions.

#errors#handlers

Flask-SQLAlchemy

Flask

Define models and query them with Flask-SQLAlchemy.

#sqlalchemy#orm#database

Custom Decorators

Flask

Build decorators to gate or augment view functions.

#decorators#middleware

Path Parameters

FastAPI

Capture typed path segments with validation.

#path#params

Query Parameters

FastAPI

Parse query strings with defaults and validation.

#query#params#validation

Pydantic Request Body

FastAPI

Validate JSON bodies with Pydantic models.

#pydantic#request-body#validation

Dependency Injection

FastAPI

Share logic via Depends and yield-based dependencies.

#dependency-injection#depends

Response Model

FastAPI

Shape and filter responses with response_model.

#response#pydantic

JWT Auth

FastAPI

Issue and verify JSON Web Tokens with OAuth2.

#auth#jwt#oauth2

Async and Await

FastAPI

Define async handlers and run blocking work in a thread.

#async#concurrency

Middleware

FastAPI

Add CORS, timing, and custom middleware.

#middleware#cors

Array Creation

NumPy

Create arrays from lists and built-in constructors.

#array#creation

Indexing and Slicing

NumPy

Slice arrays and index with boolean masks.

#indexing#slicing#mask

Broadcasting

NumPy

Combine arrays of compatible shapes without copying.

#broadcasting#shapes

Math Operations

NumPy

Apply element-wise math and reductions.

#math#ufunc#reductions

Linear Algebra

NumPy

Solve systems, factorize, and compute eigenvalues.

#linalg#matrix

Random Numbers

NumPy

Sample from distributions with a Generator.

#random#rng

Reshaping

NumPy

Reshape, transpose, and stack arrays.

#reshape#transpose#stack

Saving and Loading

NumPy

Persist arrays with .npy, .npz, and text formats.

#io#persistence

DataFrame Creation

Pandas

Build DataFrames from dicts, lists, and files.

#dataframe#creation

Indexing and Selecting

Pandas

Select rows and columns with loc, iloc, and masks.

#indexing#loc#iloc

GroupBy Operations

Pandas

Split, aggregate, and transform with groupby.

#groupby#aggregation

Merge and Join

Pandas

Combine frames with merge and concat.

#merge#join#concat

Pivot Tables

Pandas

Reshape data with pivot, melt, and pivot_table.

#pivot#reshape#melt

Time Series

Pandas

Resample, shift, and roll windows over time data.

#time-series#resample#rolling

Missing Data

Pandas

Detect, fill, and drop NaN values.

#missing-data#nan

I/O Operations

Pandas

Read and write CSV, Excel, Parquet, and SQL.

#io#csv#parquet

Line Plot

Matplotlib

Plot lines with markers, colors, and styles.

#line#plot

Bar Chart

Matplotlib

Draw vertical, horizontal, and grouped bars.

#bar#chart

Scatter Plot

Matplotlib

Visualize relationships with size and color encodings.

#scatter#plot

Subplots

Matplotlib

Arrange multiple axes with subplots and GridSpec.

#subplots#layout

Labels and Legend

Matplotlib

Annotate plots with text, arrows, and legend options.

#labels#legend#annotation

Styles and Themes

Matplotlib

Apply built-in styles and customize rcParams.

#styles#theme#rcparams

Save Figure

Matplotlib

Export figures to PNG, PDF, and SVG with DPI control.

#save#export

3D Plot

Matplotlib

Render surfaces and scatter in 3D.

#3d#surface

Read and Write Images

OpenCV

Load, display, and save images in various formats.

#io#image

Resize and Crop

OpenCV

Resize with interpolation and crop regions of interest.

#resize#crop

Color Conversion

OpenCV

Convert between BGR, RGB, HSV, and grayscale.

#color#hsv#gray

Blur and Filter

OpenCV

Smooth and sharpen images with kernels.

#blur#filter#kernel

Edge Detection

OpenCV

Detect edges with Canny, Sobel, and Laplacian.

#edge#canny#sobel

Contours

OpenCV

Find, draw, and measure contours.

#contours#shape

Face Detection

OpenCV

Detect faces with a Haar cascade classifier.

#face#cascade#detection

Threshold

OpenCV

Apply binary, adaptive, and Otsu thresholding.

#threshold#binarize

Tensor Basics

PyTorch

Create, index, and operate on tensors.

#tensor#basics

Autograd

PyTorch

Compute gradients automatically with backward().

#autograd#gradient

Dataset and DataLoader

PyTorch

Build custom datasets and batch them with DataLoader.

#dataset#dataloader

Model Definition

PyTorch

Define models with nn.Module and Sequential.

#model#nn#module

Training Loop

PyTorch

Run a full train-eval loop with loss and optimizer.

#training#loop#optimizer

GPU and CUDA

PyTorch

Move models and tensors to GPU and handle availability.

#gpu#cuda

Save and Load

PyTorch

Checkpoint models, optimizer state, and weights.

#save#load#checkpoint

Transfer Learning

PyTorch

Fine-tune a pretrained torchvision model.

#transfer-learning#pretrained

Tensor Basics

TensorFlow

Create and operate on TensorFlow tensors.

#tensor#basics

Keras Model

TensorFlow

Build models with Sequential and the functional API.

#keras#model

Layers

TensorFlow

Use core layers and build a custom one.

#layers#custom

Compile and Train

TensorFlow

Compile, fit, and evaluate a Keras model.

#compile#fit#evaluate

Custom Training Loop

TensorFlow

Step through batches with GradientTape.

#custom#training#gradienttape

Callbacks

TensorFlow

Monitor and control training with callbacks.

#callbacks#training

Save and Load

TensorFlow

Persist models in SavedModel and Keras formats.

#save#load

Data Pipeline

TensorFlow

Build efficient input pipelines with tf.data.

#tf.data#pipeline

Data Preprocessing

Machine Learning

Scale, encode, and impute features with sklearn.

#preprocessing#scaling#encoding

Train Test Split

Machine Learning

Split data into training and evaluation sets.

#split#validation

Classification

Machine Learning

Train and predict with common classifiers.

#classification#classifier

Regression

Machine Learning

Fit regressors and evaluate with RMSE and R2.

#regression

Clustering

Machine Learning

Cluster with KMeans and DBSCAN.

#clustering#unsupervised

Metrics

Machine Learning

Evaluate classifiers with confusion matrix and reports.

#metrics#evaluation

Pipeline

Machine Learning

Chain preprocessing and modeling with Pipeline.

#pipeline#column-transformer

Cross Validation

Machine Learning

Estimate performance with k-fold and grid search.

#cross-validation#grid-search

Tokenization

NLP

Tokenize text with NLTK, spaCy, and regex.

#tokenization#nltk#spacy

Stopwords

NLP

Remove common words with NLTK and spaCy.

#stopwords#filtering

Stemming and Lemmatization

NLP

Reduce words to roots with Porter, Snowball, and lemmatizers.

#stemming#lemmatization

TF-IDF

NLP

Vectorize text with TF-IDF and n-grams.

#tfidf#vectorizer

Word2Vec

NLP

Train and use word embeddings with gensim.

#word2vec#embeddings#gensim

Named Entity Recognition

NLP

Extract entities with spaCy and transformers.

#ner#spacy#transformers

Sentiment Analysis

NLP

Score text polarity with VADER and transformers.

#sentiment#vader#transformers

Text Classification

NLP

Train a TF-IDF + LogisticRegression text classifier.

#text-classification#sklearn

Pointer Basics

C

Declare pointers, dereference, and walk an array with pointer arithmetic.

#pointer#memory

Memory Management

C

Allocate, resize, and free heap memory with malloc, realloc, and free.

#memory#malloc#free

String Operations

C

Use string.h helpers for length, copy, concat, compare, and tokenize.

#string#string-h

File I/O

C

Open, read, write, and close files using the stdio FILE API.

#file-io#stdio

Structs

C

Group related fields with typedef and pass by pointer for mutation.

#struct#typedef

Function Pointers

C

Store function addresses for callbacks and dispatch tables.

#function-pointer#callback

Preprocessor Macros

C

Define object-like and function-like macros with conditional compilation.

#preprocessor#macro

Bit Operations

C

Set, clear, toggle, and test bits with bitwise operators and flags.

#bit#flags#bitwise

LINQ Query

C#

Filter, project, sort, group, and aggregate sequences with LINQ.

#linq#query

Async and Await

C#

Run I/O concurrently with async methods, await, and Task.WhenAll.

#async#task#concurrency

Properties

C#

Encapsulate state with auto, computed, validated, and init-only properties.

#properties#encapsulation

Generics

C#

Write type-parameterized methods and classes with constraints.

#generics#type-parameter

Delegates and Events

C#

Define delegate types and publish events with safe subscription.

#delegate#event

Reflection

C#

Inspect type metadata and invoke members at runtime via System.Reflection.

#reflection#metadata#attributes

Collections

C#

Use List, Dictionary, HashSet, Queue, Stack, and read-only views.

#collections#list#dictionary

File I/O

C#

Read, write, append, copy, and JSON-serialize files with File and streams.

#file-io#json#stream

Optionals

Swift

Use optional binding, nil-coalescing, chaining, and guard for safe unwrapping.

#optional#binding

Closures

Swift

Define closure expressions, capture state, and pass escaping callbacks.

#closure#functional

Protocols

Swift

Define contracts, conform with structs, and add default behavior via extensions.

#protocol#abstraction

Generics

Swift

Write type-parameterized functions and types with protocol constraints.

#generics#constraint

Structs and Classes

Swift

Compare value-type structs with reference-type classes and inheritance.

#struct#class#value-type

Error Handling

Swift

Throw and catch typed errors with do-catch, try?, try!, and rethrows.

#error#throws

Concurrency (async/await)

Swift

Run async functions, parallelize with async let, and fan out with task groups.

#async#concurrency#task

String Manipulation

Swift

Trim, split, join, replace, and index strings using Swift's Unicode API.

#string#text

Blocks, Procs, Lambdas

Ruby

Use blocks with yield, Procs, lambdas, and the & operator.

#block#proc#lambda

Classes and Modules

Ruby

Define classes with inheritance, mix in modules, and add class methods.

#class#module#oop

Iterators

Ruby

Use each, map, select, reduce, group_by, and lazy enumerators.

#iterator#enumerable

Strings

Ruby

Interpolate, trim, split, replace, and pattern-match strings.

#string#text

Hashes

Ruby

Build, default, transform, merge, and group with Hash.

#hash#dictionary

Metaprogramming

Ruby

Define methods dynamically, intercept with method_missing, and build DSLs.

#metaprogramming#dsl

Error Handling

Ruby

Raise and rescue typed exceptions with ensure and retry.

#error#exception#rescue

File I/O

Ruby

Read, write, append, traverse directories, and process CSV files.

#file#io#csv

Null Safety

Kotlin

Use nullable types, safe calls, Elvis, and smart casts for null-safe code.

#null-safety#nullable

Data Classes

Kotlin

Model immutable data with auto-generated equals, copy, and destructuring.

#data-class#model

Coroutines

Kotlin

Use launch, async, await, and structured concurrency with supervisorScope.

#coroutine#async#concurrency

Extension Functions

Kotlin

Add methods to existing types with extensions and infix operators.

#extension#function

Sealed Classes

Kotlin

Model closed hierarchies and UI state with sealed classes and when.

#sealed#when#adts

When Expression

Kotlin

Branch on values, ranges, and types with when as statement or expression.

#when#control-flow

Collections

Kotlin

Filter, map, group, partition, and chunk with functional operators.

#collections#functional

Delegation

Kotlin

Delegate interfaces, lazy properties, observables, and custom delegates.

#delegation#delegate

Data Frames

R

Create, inspect, filter, mutate, sort, aggregate, and merge data frames.

#data-frame#table

Vectors

R

Build atomic vectors, apply vectorized ops, index, and recycle.

#vector#atomic

ggplot2

R

Build layered plots with geoms, facets, and themes using the grammar of graphics.

#ggplot2#plot

dplyr

R

Chain mutate, filter, group_by, summarise, and joins with the native pipe.

#dplyr#tidyverse

Statistics

R

Compute summaries, run t-tests, linear models, ANOVA, and use distributions.

#statistics#test

Apply Family

R

Apply functions over arrays, lists, and groups with apply, lapply, sapply, tapply.

#apply#vectorization

Data Import/Export

R

Read and write CSV, TSV, RDS, RData, and text files with base R.

#io#csv#import

Functions

R

Define functions with defaults, variadic args, closures, and higher-order use.

#function#closure

Headings

Markdown

Six levels of ATX and Setext headings.

#heading#structure

Links and Images

Markdown

Inline, reference, and auto links plus images.

#link#image#reference

Code Blocks

Markdown

Fenced, indented, and inline code.

#code#fence#syntax-highlighting

Tables

Markdown

GFM tables with column alignment.

#table#formatting#gfm

Lists

Markdown

Ordered, unordered, and nested lists.

#list#ordered#unordered

Blockquotes

Markdown

Single, multi-line, and nested quotes.

#blockquote#quote

Emphasis

Markdown

Italic, bold, strikethrough, and escaping.

#emphasis#bold#italic

Task Lists

Markdown

GFM checkboxes for to-do items.

#task#checkbox#gfm

Data Types

JSON

The seven JSON value types.

#data-types#syntax

Nested Objects

JSON

Objects within objects for hierarchical data.

#object#nesting

Arrays

JSON

Lists of mixed and homogeneous values.

#array#list

Schema Validation

JSON

Validate structure with JSON Schema.

#schema#validation

JSONPath

JSON

Query expressions for locating nodes.

#jsonpath#query

Merge Patch (RFC 7386)

JSON

Partially update JSON documents.

#patch#rfc7386#merge

JSON Pointer (RFC 6901)

JSON

Address a specific value by path.

#pointer#rfc6901

Streaming (NDJSON)

JSON

Newline-delimited JSON for streaming.

#ndjson#streaming#jsonl

Scalars

YAML

Strings, numbers, booleans, null, and dates.

#scalar#string#number

Sequences and Mappings

YAML

Lists and key-value maps.

#sequence#mapping#structure

Anchors and Aliases

YAML

Reuse nodes with anchors, aliases, and merge keys.

#anchor#alias#merge

Multi-Document

YAML

Several documents in one stream.

#document#stream

Tags

YAML

Explicit type tags for custom resolution.

#tag#type#custom

Flow Style

YAML

Inline JSON-like sequences and mappings.

#flow#inline

Block Style

YAML

Indentation-based nesting.

#block#indentation

Schema Types

YAML

How YAML 1.1 and 1.2 resolve scalars.

#schema#resolution#types

Namespaces

XML

Declare and use XML namespaces.

#namespace#xmlns

XPath

XML

Path expressions for selecting nodes.

#xpath#query

DTD and Schema

XML

Document Type Definition for validation.

#dtd#schema#validation

DOM and SAX Parsing

XML

Two models for reading XML.

#dom#sax#parser

Attributes

XML

Name-value pairs on elements.

#attribute#element

CDATA Sections

XML

Escape blocks of literal text.

#cdata#escaping

XSLT

XML

Transform XML into other formats.

#xslt#transform#stylesheet

Well-Formed XML

XML

Rules every parser enforces.

#parser#well-formed#syntax

Basic Shapes

SVG

Rect, circle, ellipse, line, polygon, polyline.

#shape#rect#circle

Paths

SVG

Draw arbitrary curves via the d attribute.

#path#curve#d

Gradients

SVG

Linear and radial color blends.

#gradient#linear#radial

Transforms

SVG

Translate, rotate, scale, and skew groups.

#transform#rotate#scale

Text

SVG

Styled text and tspans.

#text#tspan#typography

Filters

SVG

Blur, shadow, and other effects.

#filter#blur#shadow

Animation

SVG

SMIL animate, transform, and opacity.

#animation#smil#animate

Patterns

SVG

Tileable fills defined in defs.

#pattern#tile#fill

Character Classes

Regex

Match sets and ranges of characters.

#character-class#shorthand

Quantifiers

Regex

Control how many times a token repeats.

#quantifier#greedy#lazy

Groups and Capturing

Regex

Capture, non-capture, and named groups.

#group#capture#named

Lookaround

Regex

Zero-width assertions around a position.

#lookahead#lookbehind#assertion

Alternation

Regex

Match one of several branches.

#alternation#or

Anchors

Regex

Match positions instead of characters.

#anchor#boundary

Backreferences

Regex

Reuse a previously captured group.

#backreference#capture

Common Patterns

Regex

Practical patterns for everyday validation.

#pattern#validation#email

Schema and Types

GraphQL

Define types, enums, and scalars.

#schema#type#enum

Queries

GraphQL

Read data with selection sets.

#query#read

Mutations

GraphQL

Write data and return the result.

#mutation#write

Subscriptions

GraphQL

Receive pushed updates over a stream.

#subscription#realtime

Fragments

GraphQL

Reusable selection sets.

#fragment#reuse

Variables

GraphQL

Parameterize operations dynamically.

#variable#parameter

Directives

GraphQL

Conditionally include or skip fields.

#directive#include#skip

Resolvers

GraphQL

Functions that fulfill each field.

#resolver#function

HTTP Methods

curl

GET, POST, PUT, and DELETE requests.

#method#get#post

Headers

curl

Set and inspect request and response headers.

#header#verbose

Authentication

curl

Basic, bearer, and OAuth credentials.

#auth#basic#bearer

Cookies

curl

Send, save, and reuse cookies.

#cookie#session

Upload and Download

curl

Transfer files to and from a server.

#upload#download#file

Proxies

curl

Route requests through HTTP or SOCKS proxies.

#proxy#socks#tunnel

Follow Redirects

curl

Chase 3xx responses automatically.

#redirect#3xx

Debugging

curl

Trace requests, timing, and transfers.

#debug#trace#timing

Methods

HTTP

Core HTTP request methods.

#method#get#post

Status Codes

HTTP

Five classes of response codes.

#status#response

Headers

HTTP

Common request and response headers.

#header#metadata

Caching

HTTP

Cache-Control, ETag, and conditional requests.

#cache#etag#conditional

Cookies

HTTP

Set, send, and expire cookies.

#cookie#session

Authentication

HTTP

Basic, Bearer, and challenge responses.

#auth#basic#bearer

Content Negotiation

HTTP

Negotiate representation with Accept headers.

#negotiation#accept

CORS

HTTP

Cross-origin preflight and responses.

#cors#preflight#origin

Module Instantiation

WebAssembly

Compile and instantiate a .wasm module.

#instantiation#compile#streaming

Linear Memory

WebAssembly

Shared, growable byte buffer.

#memory#buffer#grow

Tables

WebAssembly

Function references for indirect calls.

#table#indirect-call

Imports and Exports

WebAssembly

Exchange functions, memory, and globals.

#import#export#interop

JS Interop

WebAssembly

Pass strings through shared memory.

#interop#string#memory

Text Format (WAT)

WebAssembly

Human-readable WebAssembly.

#wat#text#s-expression

Performance

WebAssembly

Benchmark and parallelize WASM workloads.

#performance#benchmark#threads

Debugging

WebAssembly

Inspect modules and handle traps.

#debug#inspect#trap

Pattern Matching

Scala

Destructure values and match cases in Scala.

#pattern-matching#match

Case Classes

Scala

Immutable data classes with auto-generated equals/hashCode/toString.

#case-class#data#immutable

Collections Operations

Scala

Functional collection operations: map, filter, fold, groupBy.

#collections#functional

Traits and Mixins

Scala

Compose behaviors using traits with default implementations.

#trait#mixin#composition

Futures and Async

Scala

Asynchronous computation with Future and ExecutionContext.

#future#async#concurrency

Implicits (Given/Using in Scala 3)

Scala

Type-class derivation and context passing via implicits.

#implicit#type-class#scala3

Akka Actors (Pekko)

Scala

Message-passing concurrency with the actor model.

#actor#akka#concurrency

Type Classes (Cats-style)

Scala

Ad-hoc polymorphism via type classes.

#type-class#cats#polymorphism

Matrix Creation and Operations

MATLAB

Create and operate on matrices in MATLAB.

#matrix#linear-algebra

2D Plotting

MATLAB

Create line plots with labels, legends, and styling.

#plot#visualization

Functions and Scripts

MATLAB

Define functions in separate files or at end of scripts.

#function#anonymous

Cell Arrays and Structs

MATLAB

Heterogeneous data containers in MATLAB.

#cell#struct#data

File I/O

MATLAB

Read and write .mat, .csv, and text files.

#file#io#csv

ODE Solvers

MATLAB

Solve ordinary differential equations with ode45.

#ode#solver#numerical

Signal Processing (FFT)

MATLAB

Compute and visualize the FFT of a signal.

#fft#signal#frequency

Struct Arrays and Tables

MATLAB

Work with struct arrays and modern table data type.

#table#struct#data

Variables and Types

Visual Basic

Declare variables with Dim and type inference.

#variables#types

Loops and Iteration

Visual Basic

For, For Each, While, and Do loops in VB.

#loop#iteration

Sub and Function Procedures

Visual Basic

Define Sub (no return) and Function (returns value).

#sub#function#procedure

Windows Forms Basics

Visual Basic

Create a simple WinForms application.

#winforms#ui#events

File I/O

Visual Basic

Read/write text files and use My.Computer.FileSystem.

#file#io

Error Handling (Try/Catch)

Visual Basic

Structured exception handling in VB.

#error#exception#try-catch

Collections (List, Dictionary)

Visual Basic

Generic collections in VB.NET.

#list#dictionary#linq

LINQ Query Expressions

Visual Basic

Query data with VB LINQ syntax.

#linq#query

Units and Classes

Delphi

Define units with interface and implementation sections.

#unit#class#oop

VCL Form Basics

Delphi

Create a form with event handlers in Delphi VCL.

#vcl#form#events

Properties and Events

Delphi

Define properties and event handlers in Delphi.

#property#event#observer

Generics

Delphi

Type-safe containers with generics in Delphi.

#generics#collections

Interfaces and Reference Counting

Delphi

Define interfaces with automatic reference counting.

#interface#reference-counting

Exception Handling

Delphi

Try/Except/Finally in Delphi.

#exception#try-except#try-finally

RTTI (Runtime Type Information)

Delphi

Inspect types and properties at runtime.

#rtti#reflection#attributes

FireDAC Database Access

Delphi

Query SQL databases with FireDAC.

#firedac#database#sql

Arrays and Vector Operations

Fortran

Create and operate on arrays in modern Fortran.

#array#vector

Subroutines and Functions

Fortran

Define reusable procedures in Fortran.

#subroutine#function#procedure

Modules and Derived Types

Fortran

Organize code with modules and OOP-style types.

#module#type#oop

File I/O and Formatting

Fortran

Read/write files with formatted output.

#io#file#format

OpenMP Parallelism

Fortran

Parallelize loops with OpenMP directives.

#openmp#parallel#performance

Numerical: Linear Algebra (BLAS/LAPACK)

Fortran

Call BLAS/LAPACK for matrix operations.

#blas#lapack#linear-algebra

Derived Types and Pointers

Fortran

Custom types with allocatable components and pointers.

#derived-type#pointer#linked-list

Pointers and Allocatables

Fortran

Dynamic memory allocation in Fortran.

#allocatable#pointer#memory

Tables (Arrays and Maps)

Lua

Tables are Lua's only data structure — used as arrays and maps.

#table#array#map

Metatables and OOP

Lua

Implement OOP and operator overloading via metatables.

#metatable#oop#operator

Coroutines

Lua

Cooperative multitasking with coroutines.

#coroutine#generator

Modules

Lua

Create reusable modules in Lua.

#module#require

String Manipulation

Lua

Pattern matching and string functions in Lua.

#string#pattern#match

File I/O

Lua

Read and write files in Lua.

#io#file

OOP with Inheritance

Lua

Implement class inheritance using metatables.

#oop#inheritance#class

Error Handling (pcall)

Lua

Protected calls and error handling in Lua.

#error#pcall#exception

Pattern Matching

Elixir

Pattern matching is core to Elixir — used everywhere.

#pattern-matching#match

Pipe Operator

Elixir

Chain function calls with the |> pipe operator.

#pipe#functional

Processes and Messages

Elixir

Spawn lightweight processes and send messages.

#process#actor#message

GenServer

Elixir

Build stateful server processes with GenServer behaviour.

#genserver#otp#state

Supervisors and OTP

Elixir

Build fault-tolerant supervision trees.

#supervisor#otp#fault-tolerance

Protocols and Enums

Elixir

Polymorphism via protocols and the Enum module.

#protocol#enum#polymorphism

Enum and Stream Operations

Elixir

Functional collection operations in Elixir.

#enum#stream#functional

Metaprogramming with Macros

Elixir

Write code that writes code at compile time.

#macro#metaprogramming#ast

Types and Type Classes

Haskell

Define algebraic data types and type classes.

#type#type-class#adt

Maybe and IO Monads

Haskell

Use Maybe for safety and IO for side effects.

#monad#maybe#io

List Comprehensions and Laziness

Haskell

Generate lists with comprehensions and leverage laziness.

#list#lazy#comprehension

Functors, Applicatives, Monad Type Classes

Haskell

The three core abstraction type classes.

#functor#applicative#monad

IO and do Notation

Haskell

Side-effectful programming in Haskell.

#io#do-notation

Modules and Imports

Haskell

Organize code with modules and control exports.

#module#import#export

Laziness and Strictness

Haskell

Understand lazy evaluation and when to be strict.

#lazy#strict#performance

Applicative Functors

Haskell

Apply functions in a context with less power than Monad.

#applicative#validation

Classes and Constructors

Dart

Define classes with named and factory constructors.

#class#constructor#oop

Async/Await and Futures

Dart

Asynchronous programming with Future and async/await.

#async#future#stream

Collections (List, Map, Set)

Dart

Work with collections and functional operations.

#list#map#set

Null Safety

Dart

Sound null safety with ? and ! operators.

#null-safety#nullable

Generics

Dart

Type-safe reusable classes and methods.

#generic#type-safe

Mixins and Extensions

Dart

Compose behaviors without inheritance.

#mixin#extension#composition

Futures and Streams

Dart

Work with single and multiple async values.

#future#stream#async

Isolates (True Parallelism)

Dart

Run code in separate isolates for CPU-bound work.

#isolate#parallel#concurrency

Scalars, Arrays, and Hashes

Perl

Perl's three main data types with sigils.

#scalar#array#hash

Regular Expressions

Perl

Perl is famous for its powerful regex support.

#regex#pattern

Subroutines and References

Perl

Define subs and use references for complex data.

#subroutine#reference

Complex Data Structures

Perl

Build nested structures with references.

#reference#data-structure

Modules and Packages

Perl

Create reusable modules with package keyword.

#module#package#export

File I/O

Perl

Read and write files with filehandles.

#file#io

OOP with Moose

Perl

Modern object-oriented programming in Perl.

#oop#moose#class

One-Liners and CLI Tricks

Perl

Common Perl one-liners for text processing.

#cli#one-liner#text

Contract Basics

Solidity

Define a basic smart contract with state and functions.

#contract#state#modifier

Functions and Visibility

Solidity

Function visibility, payable, and return values.

#function#visibility#payable

Modifiers and Access Control

Solidity

Reuse validation logic with modifiers.

#modifier#access-control#security

Events and Logs

Solidity

Emit events for off-chain listeners.

#event#log#indexed

Mappings, Structs & Nested Storage

Solidity

Group related data with structs and look it up by key with mappings.

#mapping#struct#storage

Inheritance, Abstract & Interfaces

Solidity

Reuse logic via inheritance; define contracts with abstract and interface.

#inheritance#interface#abstract

Payable, receive & fallback (ETH flows)

Solidity

Receive ETH via payable functions and the receive/fallback hooks.

#payable#receive#fallback

Reentrancy & Checks-Effects-Interactions

Solidity

Harden contracts against the most common smart-contract attack.

#security#reentrancy#best-practice

Buffers, Windows & Tabs

Vim

Edit multiple files with buffers, split windows, and tab pages.

#buffer#window#tab

Search & Substitute

Vim

Find text with / and replace with :s, leveraging regex and ranges.

#search#substitute#regex

Registers (Multi-Clipboard)

Vim

Store yanks/deletes in named registers and paste from them.

#register#clipboard#yank

Marks (Bookmarks)

Vim

Jump back to positions in a file or across files with marks.

#mark#navigation#bookmark

Macros (Recorded Keystrokes)

Vim

Record a sequence of keys and replay it to automate repetitive edits.

#macro#automation#register

Folding (Collapse Code)

Vim

Hide regions of code to focus on structure with fold methods.

#fold#outline#navigation

Plugin Managers & Ecosystem

Vim

Install, configure and discover plugins with vim-plug / packer / lazy.

#plugin#vim-plug#lazy

LSP, Completion & Diagnostics

Vim

Get IDE features (autocomplete, go-to-definition, diagnostics) via LSP.

#lsp#completion#diagnostics

set / get — Basic Key-Value

Memcached

Store and retrieve values by key with expiration and flags.

#set#get#basic

add / replace / append / prepend

Memcached

Conditional writes and in-place string concatenation.

#add#replace#append

cas / gets — Compare-And-Swap

Memcached

Optimistic locking: update a key only if it hasn't changed since you read it.

#cas#gets#concurrency

stats — Server Metrics & Slabs

Memcached

Inspect memory, hit rate, evictions and per-slab allocation.

#stats#metrics#monitoring

flush_all — Invalidate Everything

Memcached

Logically invalidate all keys instantly (lazy deletion).

#flush_all#invalidation#namespace

Expiration, Eviction & TTL Strategy

Memcached

Choose TTLs wisely and understand how Memcached evicts under pressure.

#expiration#ttl#eviction

Text vs Binary Protocol & Consistent Hashing

Memcached

Pick the right protocol and shard across servers without reshuffling.

#protocol#cluster#ketama

Patterns: Read-Through, Write-Behind & Session Cache

Memcached

Apply Memcached to common application caching problems.

#pattern#read-through#session

Connecting: URLs, TLS, AUTH & Select

Redis CLI

Connect to standalone, TLS, authenticated, or non-default DB indexes.

#connection#tls#auth

Interactive Mode, HELP & Inspecting

Redis CLI

Navigate the REPL, discover commands, and introspect the server.

#interactive#help#info

MULTI / EXEC / WATCH (Transactions)

Redis CLI

Queue commands atomically and use optimistic locking with WATCH.

#transaction#multi#exec

Pub/Sub: SUBSCRIBE, PUBLISH & PSUBSCRIBE

Redis CLI

Fan-out messaging with channels and pattern subscriptions.

#pubsub#publish#subscribe

MONITOR, SLOWLOG & Latency Debugging

Redis CLI

Watch every command in real time and find slow queries.

#monitor#slowlog#latency

EVAL, Lua & Function Stats (Server-side Scripting)

Redis CLI

Run atomic server-side Lua scripts; load and call functions.

#lua#eval#script

RDB / AOF Persistence & Backup

Redis CLI

Trigger snapshots, manage AOF rewrite, and capture a safe backup.

#persistence#rdb#aof

ACL Users & Cluster Operations

Redis CLI

Manage ACL users, redis-check tools, and cluster resharding.

#acl#cluster#security

Broadcasting & Vectorization

Julia

Apply a function element-wise over arrays with dot syntax and @.

#broadcasting#arrays#performance

Multiple Dispatch

Julia

Select methods by the runtime types of all arguments, not just the receiver.

#dispatch#types#oop

Parametric Types & Performance

Julia

Define generic, type-stable containers that compile to specialized code.

#types#performance#generics

Macros & Expressions

Julia

Manipulate Julia syntax trees as first-class data via :expr and macro.

#macros#metaprogramming#expressions

Multi-threading & Distributed Compute

Julia

Parallelize loops with @threads and offload tasks with @spawn / pmap.

#parallel#threads#distributed

DataFrame Operations (DataFrames.jl)

Julia

Filter, transform, group, and join tabular data with DataFrames.jl.

#dataframe#data#tables

Performance Tips: @inbounds, @fastmath, views

Julia

Write Julia that runs at C speed by removing bounds checks, avoiding allocations, and using views.

#performance#optimization#simd

Solving ODEs with DifferentialEquations.jl

Julia

Define and numerically solve an initial-value ODE with adaptive stepping.

#ode#scientific#differential-equations

Hello World via Linux syscall

Assembly

A freestanding x86-64 program that prints and exits using only kernel syscalls.

#syscall#linux#hello-world

Function Call Convention (System V AMD64)

Assembly

Pass args in registers, preserve callee-saved regs, keep rsp 16-byte aligned.

#calling-convention#abi#functions

Loop Summation (1..N)

Assembly

Sum integers 1..N with a counted loop using dec/jnz.

#loops#arithmetic#control-flow

strlen — Scan Until NUL

Assembly

Compute C-string length by scanning memory until a zero byte.

#string#sse#optimization

memcpy — Copy with rep movsb

Assembly

Use the rep movsb string instruction for a tight memory copy.

#memory#string-ops#rep

Bit Manipulation: popcount, ctz, abs

Assembly

Use BMI/ABM instructions for branchless bit operations.

#bitwise#bmi#branchless

Read a File via syscalls

Assembly

open/read/write/close a file using only Linux syscalls.

#syscall#file#linux

Recursive factorial

Assembly

Implement factorial(n) recursively with a proper stack frame.

#recursion#stack#factorial

Ping-Pong Processes

Erlang

Two processes pass messages back and forth using spawn and receive.

#spawn#send#receive

gen_server Counter

Erlang

Build a stateful server with the gen_server behaviour.

#gen_server#otp#behaviour

Supervisor Tree

Erlang

Define a supervisor that starts workers and restarts them on crash.

#supervisor#otp#fault-tolerance

Selective Receive with References

Erlang

Match a specific reply out of many messages using a unique reference.

#receive#references#rpc

Links, Exit Trapping & 'Let It Crash'

Erlang

Use link and trap_exit to detect process death and recover.

#link#exit#fault-tolerance

Stateful Server via Tail Recursion

Erlang

Hold mutable state in a process by threading it through recursive calls.

#state#tail-recursion#server

Parallel Map with rpc:pmap

Erlang

Apply a function to each list element in parallel across processes.

#parallel#pmap#list

Hot Code Upgrade

Erlang

Reload a module's code without stopping the running system.

#hot-code#release#upgrade
Last updated: 2026-08-01