Skip to content

Instantly share code, notes, and snippets.

@hopeseekr
hopeseekr / composer-version-constraints.json
Created May 30, 2025 08:21
All Actual Composer Version Constraints
[
"3.7.*@stable | 3.6.*@stable | 3.5.*@stable | 3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable",
"^0.10 | ^0.11 | ^0.12 | ^0.13 | ^0.14 | ^0.15 | ^0.16 | ^0.17 | ^0.18 | ^0.19 | ^0.20 | ^0.21 | ^0.22 | ^0.23 | ^0.24 | ^0.25 | ^0.26 | ^0.27 | ^0.28 | ^0.29",
"^0.10.2|^0.11.0|^0.12.0|^0.13.0|^0.21.0|^0.22.0|^0.23.0|^0.24.0|^0.25.0|^0.26.0|^0.27.0|^0.28.0|^0.29.0|^0.30.0|^0.31.0|^0.32.0|^0.33.0|^0.34.0|^0.35.0",
"^0.10 | ^0.11 | ^0.12 | ^0.13 | ^0.14 | ^0.15 | ^0.16 | ^0.17 | ^0.18 | ^0.19 | ^0.20 | ^0.21 | ^0.22 | ^0.23 | ^0.24 | ^0.25 | ^0.26 | ^0.27",
"~3.7@stable | 3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable",
"103.0.4-p9 || 103.0.4-p11 || 103.0.5-p8 || 103.0.5-p10 || 103.0.6-p6 || 103.0.6-p8 || 103.0.7 || 103.0.7-p1 || 103.0.7-p3",
"3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@sta
@hopeseekr
hopeseekr / swe_bench-tests.json
Created May 26, 2025 16:11
SWE-Bench Test Datasets
{
"url": "https://api.github.com/repos/pvlib/pvlib-python/pulls/1",
"id": 29411065,
"node_id": "MDExOlB1bGxSZXF1ZXN0Mjk0MTEwNjU=",
"html_url": "https://github.com/pvlib/pvlib-python/pull/1",
"diff_url": "https://github.com/pvlib/pvlib-python/pull/1.diff",
"patch_url": "https://github.com/pvlib/pvlib-python/pull/1.patch",
"issue_url": "https://api.github.com/repos/pvlib/pvlib-python/issues/1",
"number": 1,
"state": "closed",
@hopeseekr
hopeseekr / calibre-web.apache.conf
Created March 29, 2025 17:18
Optimized Calibre-web Apache reverse proxy
# Prequiste: For security, set Calibre to listen to 127.0.0.4:8083:
# Edit `/etc/systemd/system/multi-user.target.wants/calibre-web.service`:
# Change to `ExecStart=/usr/lib/calibre-web/cps.py -i 127.0.0.4`
# sudo systemctl daemon-reload
# sudo systemctl restart calibre-web
<VirtualHost *:443>
ServerName read.your.site
# SSL Configuration
@hopeseekr
hopeseekr / 001-calibre-web.conf
Created March 29, 2025 15:49
Optimized Calibre-web Nginx reverse proxy
# Prequiste: For security, set Calibre to listen to 127.0.0.4:8383:
# Admin -> Basic Configuration -> Server Settings: Server port 8383.
# Then edit `/etc/systemd/system/multi-user.target.wants/calibre-web.service`:
# Change to `ExecStart=/usr/lib/calibre-web/cps.py -i 127.0.0.4`.
# sudo systemctl daemon-reload
# sudo systemctl restart calibre-web
server {
listen [::]:443 ssl;
listen 443 ssl;
@hopeseekr
hopeseekr / ComposerConstraintsMatchingTest.php
Last active March 27, 2025 15:57
Automated Development of Composer version constraints reverse-engineering
<?php
namespace Bettergist\Tests\Feature;
use Bettergist\Tests\TestCase;
use Composer\Semver\Constraint\Constraint;
use Composer\Semver\Semver;
use Composer\Semver\VersionParser;
class ComposerConstraintsMatcherTest extends TestCase
@hopeseekr
hopeseekr / StackOverflow Stats.md
Last active June 9, 2025 12:46
StackOverflow Dec 2024 stats

Disclaimer: I'm in the Top 1% of StackOverflow contributors with 23,315 rep points.

I asked 1 high-quality question in 2024, and it was closed almost immediately, and I haven't engaged with the site since.

If someone with 20,000+ karma has their nicely-formatted questions closed so quickly, what must the newbies and rank-in-file encounter? This is probably a big reason why it's declining.


-- Combine these two queries into a table.
SELECT
sub.min_version AS version,
COUNT(*) AS count
FROM (
SELECT
package,
min(version) AS min_version
FROM
@hopeseekr
hopeseekr / arch-chroot
Last active August 26, 2024 14:42 — forked from bhelm/arch-chroot.sh
Chroot script from Archlinux (arch-chroot), works on any distri
#!/bin/bash
shopt -s extglob
# generated from util-linux source: libmount/src/utils.c
declare -A pseudofs_types=([anon_inodefs]=1
[autofs]=1
[bdev]=1
[bpf]=1
[binfmt_misc]=1
@hopeseekr
hopeseekr / redis-active-lines.log
Last active March 25, 2024 02:17
Redis Authorship Stats 2024-03-20
Redis Contributors with more than 10 Active lines of code in the `unstable` branch, ignoring whitespace changes.
Statistics based on HEAD
Active files: 1,566
Active lines: 417,517
Total commits: 9,516
Note: Files matching MIME type image, binary has been ignored
+----------------------------------+---------+---------+-------+--------------------+
@hopeseekr
hopeseekr / thin_space.php
Created January 21, 2023 19:50
ASCII Space vs UTF-8 Thin Space in PHP
<?php
/** See it live: https://onlinephp.io/c/551a0 **/
$helloWorld = [
'ascii' => 'Hello, World!',
'utf-8' => 'Hello, World!',
];
$spacePos = strpos($helloWorld['ascii'], ' ');