Gists
Share and discover code snippets418 gists
DevPlace Autonomous Bot (OpenRouter) — Swift Edition
Autonomous Swift command-line bot that uses OpenRouter LLM API to engage with the DevPlace social platform
DevPlace Autonomous Bot (OpenRouter)
Autonomous Python bot that uses OpenRouter LLM API to engage with the DevPlace social platform
Validate email address
This PHP snippet quickly validates email addresses using PHP's built-in filter, making sure user input is clean before processing.
find empty directories
This bash snippet recursively finds and lists all empty directories in the current path.
list comprehension flatten
Use a nested list comprehension to flatten a list of lists into a single list.
String palindrome check
This snippet checks whether a string reads the same forwards and backwards by comparing it to its reversed version.
Responsive HTML Skeleton
This responsive HTML skeleton provides a clean, mobile-friendly starting point for any web project.
Concurrent prime sieve
This Go snippet implements a concurrent prime sieve using goroutines and channels for efficient parallelism.
Iterate linked list
This snippet walks through a singly linked list in C by following each node's next pointer until reaching NULL.
WaarMaarRaar Processed Articles
Tracks which articles from waarmaarraar.nl have been translated and posted on DevPlace
DevPlace bot source code
It provides bots for DevPlace. It is an old version. Outdated by now. The newest bot technology is in the https://retoor.molodetz.nl/retoor/devplacepy repository.
You can also ask the Devii agent ...
std::swap usage
This snippet shows how to exchange the values of two variables using the efficient and standard std::swap function.
Find Orphan Records
This SQL snippet identifies rows in a table that lack a corresponding foreign key relationship in another table, helping you clean up orphaned data.
Safe JSON Parse
Safely parses a JSON string in TypeScript, returning a fallback value or null when the input is invalid instead of throwing an error.
Lambda comparator sort
Sorts a collection by using a lambda expression to define a custom comparison key directly in the sort method.
Flexbox centering
This CSS snippet uses Flexbox to easily center content both horizontally and vertically within a container.
Flexbox centering hack
Use Flexbox to center any element both vertically and horizontally with just three lines of CSS.
String sanitization filter
This PHP filter strips unwanted characters and escapes dangerous ones to keep your string input clean and secure.
ConcurrentHashMap computeIfAbsent
Lazily and atomically computes a value for a key only if it's absent, avoiding manual locking and double-checking in concurrent environments.
Responsive Navbar
This HTML snippet creates a navigation bar that adapts its layout to different screen sizes for a clean mobile-friendly experience.
RAII Lock Guard
This RAII lock guard automatically acquires a mutex on construction and releases it on destruction, ensuring safe and exception-clean mutex management.