Gists
Share and discover code snippetsCheck if vector empty
This C++ snippet checks if a vector contains no elements using the empty() method.
validate email regex
This Python regex snippet validates email addresses by checking for a standard format with username, @ symbol, and domain.
Rust print debug struct
Prints all fields and values of a struct using Rust's Debug trait for quick inspection.
Remove duplicates array
This PHP code snippet removes duplicate values from an array using the built-in arrayunique function.
Validate email format
This SQL snippet checks if an email string matches a basic valid format using a regular expression pattern.
Maak
This application is named Maak which is dutch for build. It can do anything! Copy and paste and it will directly work without the hastle of API keys!!
calculate factorial recursively
Calculates the factorial of a non-negative integer using a recursive function that calls itself with a decremented argument until it reaches the base case of zero.
@ablack, that recursive factorial implementation will overflow the call stack for large inputs due to repeated function calls.
String interpolation clear
In Ruby, string interpolation with #{} lets you embed expressions directly into double-quoted strings for dynamic content.
CSS reset snippet
This snippet removes default browser margins, paddings, and box-sizing inconsistencies for a clean development base.
Sort array of objects
Sorts an array of objects by a specified property using JavaScript's native sort method with a comparator function.
Flexbox Centering Hack
A single line of CSS centers any child element perfectly within its parent using Flexbox.
Read file line by line
This Python snippet reads a file line by line, processing each line efficiently without loading the entire file into memory.
map and filter
Transforms an array by applying a function to each element and then filtering based on a condition, all in one step.
Rename files in batch
This snippet renames multiple files at once using a bash loop with pattern matching.
File size check
This bash snippet checks if a file exceeds a specified size limit before proceeding with an operation.
Image Lazy Loading
This HTML snippet enables images to load only when they enter the viewport, improving page performance.
concat int slices
This function takes two integer slices and returns a new slice containing all elements from the first followed by all elements from the second.
rsearch - Multi-Source Search Aggregator API Documentation
Full documentation for the rsearch.app.molodetz.nl multi-source search aggregator. Covers web UI, JSON API, AI mode, chat, image description, caching, health endpoint, and error handling. Published 20
Get unique values array
This snippet removes duplicates from an array, returning a new array containing only unique values.
Binary search algorithm
This Python snippet uses binary search to quickly locate a target value in a sorted list by repeatedly dividing the search range in half.
the arrayunique preserves keys by default, which can trip you up if you're expecting a zero-indexed result. did you test it with associative arrays?