Skip to content

Instantly share code, notes, and snippets.

Working from home

Till Krüss tillkruss

Working from home
Block or report user

Report or block tillkruss

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tillkruss / worker.js
Created Jul 17, 2018
A Cloudflare worker that allow cookie/path based caching.
View worker.js
* Time-to-live in seconds for cached requests.
const cacheTtl = 300;
* List of request paths to cache.
const cachedPaths = [
tillkruss / AppServiceProvider.php
Last active Jul 27, 2019
ElasticSearch engine for Laravel Scout
View AppServiceProvider.php
resolve(EngineManager::class)->extend('elasticsearch', function ($app) {
return new ElasticsearchEngine(
tillkruss /
Last active Jun 13, 2017
AWS Lambda function that optimizes images uploaded to a S3 bucket using's API.

Lambda S3 Kraken


  • Event type: ObjectCreated
  • Suffix: jpg

Environment variables

tillkruss / stream-s3-as-zip.php
Last active Feb 16, 2017
Stream files from S3 as ZIP file.
View stream-s3-as-zip.php
use Aws\S3\S3Client;
use ZipStream\ZipStream; //
use GuzzleHttp\Client as HttpClient;
protected function streamAsZip($files)
$s3 = S3Client::factory('...');
$zip = new ZipStream("");
tillkruss / AuthServiceProvider.php
Last active Jul 18, 2018
Case-insensitive PostgreSQL eloquent user provider for Laravel 5.
View AuthServiceProvider.php
namespace App\Providers;
use Auth;
use App\Support\EloquentUserProvider;
class AuthServiceProvider extends ServiceProvider
public function boot(GateContract $gate)

Keybase proof

I hereby claim:

  • I am tillkruss on github.
  • I am tillkruss ( on keybase.
  • I have a public key whose fingerprint is 6490 DEB6 8D18 F0A3 49BD CB9C 8874 10C6 42BC 23BB

To claim this, I am signing this object:

tillkruss / redis-test.php
Last active Aug 20, 2016
[WordPress] Redis Test MU-Plugin
View redis-test.php
Plugin Name: Redis Test
Plugin URI:
Description: Redis connection test.
Author: Till Krüss
Version: 1.0
Author URI:
tillkruss / app\Http\Kernel.php
Last active Nov 9, 2018
Running Laravel 5 on Heroku behind CloudFlare
View app\Http\Kernel.php
class Kernel extends HttpKernel
protected $middleware = [
tillkruss / Database.php
Last active Mar 4, 2016
[Laravel 5.1] Use Redis PECL/HHVM extension
View Database.php
namespace App\Redis;
use Redis;
use Illuminate\Redis\Database as RedisDatabase;
use Illuminate\Contracts\Redis\Database as DatabaseContract;
class Database extends RedisDatabase implements DatabaseContract
tillkruss / wp-api-timeouts.php
Last active Jan 23, 2018
Prevent `` requests timeouts: "Warning: An unexpected error occurred. Something may be wrong with or this server's configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to"
View wp-api-timeouts.php
// increase `timeout` for `` requests
add_filter( 'http_request_args', function( $request, $url ) {
if ( strpos( $url, '://' ) !== false ) {
$request[ 'timeout' ] = 15;
return $request;
You can’t perform that action at this time.