Skip to content
The App Code

Browse all entries

Every published model, bias and explainer — cross-linked and cited.

How-to

Debounce a Function in JavaScript

Delay running a function until input stops arriving, using a timer that resets on each call.

How-to

Fetch Data in React with useEffect

Load data on mount inside useEffect, storing the result in state and cleaning up to avoid setting state after unmount.

How-to

Format a Date in Kotlin

Format date and time values using the java.time API and DateTimeFormatter.

How-to

Format a Date in Python

Turn a datetime into a string with strftime and parse strings back with strptime.

How-to

Format a Date in Swift

Turn a Date into a localized string with the modern formatted API or a reusable DateFormatter.

How-to

Make a GET Request in JavaScript

Fetch JSON from an API in the browser or Node using the async fetch API.

How-to

Make a GET Request in Kotlin

Perform an HTTP GET on Android using the OkHttp client with a coroutine.

How-to

Make a GET Request in Python

Fetch JSON from an API using the requests library, raising on error status codes.

How-to

Make a GET Request in Swift

Fetch data from a URL using URLSession's async/await API and decode the response.

Concept

Null Safety in Kotlin

A type system that distinguishes nullable from non-nullable references to eliminate most null-pointer exceptions.

Concept

Optionals in Swift

A type-level way to represent the presence or absence of a value, forcing you to handle nil explicitly.

How-to

Parse JSON in Kotlin

Decode JSON into data classes using the kotlinx.serialization library.

How-to

Parse JSON in Python

Convert a JSON string into Python dicts and lists with the standard-library json module.

How-to

Parse JSON in Swift

Decode JSON into strongly typed Swift structs with JSONDecoder and the Codable protocol.

How-to

Remove Duplicates from an Array in JavaScript

Deduplicate an array by passing it through a Set and spreading it back to an array.

How-to

Reverse a String in Python

Reverse a string with the extended slice [::-1], the idiomatic one-liner in Python.