Snippets
About 900 small functions, components and hooks in Go, Python, JavaScript, React and C#, searchable alongside the rest of the wiki.
Most of these come from public snippet collections and are reproduced here so they can be searched with the rest of the wiki. Each one is a short example, not a library: none validates its input, handles errors or considers allocation in a hot path, and none ships with tests. Read the explanation and the edge cases before copying one, then add the validation and tests your code needs. For language guidance see Go, Python and TypeScript.
- C# snippets80 snippets · Small C# methods for collections, strings, maths and dates, each with a short explanation and an example call.
- Go snippets60 snippets · Small Go functions for slices, strings and maths, each with a short explanation and an example call.
- JavaScript snippets536 snippets · Small JavaScript functions for arrays, objects, strings, dates and the browser DOM, each with a short explanation and an example call.
- Python snippets159 snippets · Small Python functions for lists, dictionaries, strings, maths and dates, each with a short explanation and an example call.
- React snippets77 snippets · React components such as accordions, modals and data tables, and hooks for state, events and browser APIs, each with an example use.