Skip to content
Türker Yıldırım
Writing
Snippets
About
Search
Snippets
One-liners, regexes and short scripts worth keeping. Copy, adapt, move on.
A grid that wraps without a media query
bootstrap
css
html
performance
Walk a category tree with a recursive CTE
migrations
mysql
query-optimization
sql
Retry an HTTP call with exponential backoff in PHP
api-design
async
monitoring
php
Issue a wildcard certificate with a DNS challenge
bash
deployment
security
tls
Claim a queue row without two workers taking it
async
mysql
queues
sql
Rank rows within a group in one query
indexing
mysql
query-optimization
sql
Delete Elasticsearch indices older than 30 days
backup
bash
elasticsearch
logging
Format bytes as a human readable size in PHP
linting
oop
php
refactoring
A responsive grid with no media queries
bootstrap
css
html
performance
Check a TLS certificate chain from the command line
bash
monitoring
security
tls
Find the biggest key in Redis by memory
bash
monitoring
performance
redis
Find which systemd unit owns a process
bash
linux
logging
monitoring
Show replication lag on a MySQL replica
architecture
monitoring
mysql
sql
Await several promises without failing on the first
async
javascript
logging
performance
Reload nginx only if the config is valid
bash
ci-cd
deployment
nginx
List systemd timers and when they next run
bash
deployment
linux
monitoring
Build only one stage of a multi-stage Dockerfile
bash
ci-cd
deployment
docker
Read a JSON config file with a fallback in PHP
linting
oop
php
refactoring
Limit a container to one CPU and 512MB
docker
linux
monitoring
performance
Run PHPStan on changed files only
bash
ci-cd
phpstan
static-analysis
Rate limit a location in nginx
deployment
nginx
performance
security
Tail a Kibana-bound log with jq
bash
elk-stack
logging
monitoring
Find tables with no primary key
indexing
migrations
mysql
sql
Show the size of every Docker image layer
bash
docker
monitoring
performance
Ignore a PHPStan error by pattern
bash
phpstan
refactoring
static-analysis
Show the InnoDB buffer pool hit rate
monitoring
mysql
performance
sql
Test an SSL configuration from the command line
bash
monitoring
security
tls
Redirect HTTP to HTTPS in nginx
deployment
nginx
security
tls
Copy a file out of a running container
backup
bash
deployment
docker
Issue a Let’s Encrypt certificate with certbot
bash
nginx
security
tls
Show the systemd units that failed to start
bash
linux
logging
monitoring
Enable gzip for JSON responses in nginx
caching
deployment
nginx
performance
List the largest autoloaded options in WordPress
mysql
wordpress
wp-cli
wp-performance
Debounce a function with ES6
html
javascript
performance
refactoring
Generate a UUID version 4 in PHP
design-patterns
oop
php
security
Lazy-load images with IntersectionObserver
css
html
javascript
performance
Check when a TLS certificate expires
bash
monitoring
security
tls
Deep clone an object in JavaScript
javascript
oop
refactoring
testing
Remove all stopped Docker containers
bash
deployment
docker
linux
Add a generated column over a JSON field
indexing
migrations
mysql
sql
Newer
1
2
3
4
…
6
Older