Skip to content

Instantly share code, notes, and snippets.

View tillkruss's full-sized avatar
🏠
Working from home

Till Krüss tillkruss

🏠
Working from home
View GitHub Profile
@tillkruss
tillkruss / worker.js
Created July 17, 2018 16:18
A Cloudflare worker that allow cookie/path based caching.
/**
* Time-to-live in seconds for cached requests.
*/
const cacheTtl = 300;
/**
* List of request paths to cache.
*/
const cachedPaths = [
@tillkruss
tillkruss / cluster.php
Last active April 9, 2021 01:30
PhpRedis Cluster Test
<?php
var_dump('PhpRedis: '. phpversion('redis'));
$redis = new RedisCluster(
null,
[
'tls://127.0.0.1:7001',
'tls://127.0.0.1:7002',
],
@tillkruss
tillkruss / ocp.sh
Last active November 18, 2021 18:15
cd ./wordpress
wget https://objectcache.pro/plugin/redis-cache-pro.zip?token=0000000000 | unzip
cp redis-cache-pro/stubs/mu-plugin.php wp-content/mu-plugins/redis-cache-pro.php
mv redis-cache-pro wp-content/mu-plugins
rm redis-cache-pro.zip
read -r -d '' WP_REDIS_CONFIG <<- EOM
@tillkruss
tillkruss / leaddyno.html
Last active July 13, 2021 17:29
Async Lead Dyno script
<script>
(function(key) {
var script = document.createElement('script');
script.src = 'https://static.leaddyno.com/js';
script.async = true;
script.onload = function () {
LeadDyno.key = key;
LeadDyno.recordVisit();
LeadDyno.autoWatch();
};
@tillkruss
tillkruss / versions.md
Last active March 22, 2024 07:12
PHP API versions

PHP API versions

Version API
7.3 20180731
7.4 20190902
8.0 20200930
8.1 20210902
8.2 20220829
8.3 20230831