Skip to content

Instantly share code, notes, and snippets.

Working from home

Till Krüss tillkruss

Working from home
View GitHub Profile
laravel-shift / .php_cs.laravel.php
Last active Mar 2, 2021
PHP CS Fixer - Laravel Coding Style Ruleset
View .php_cs.laravel.php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]
adamwathan / 1-add-macros.php
Last active Nov 8, 2020
Multiformat Endpoints in Laravel
View 1-add-macros.php
namespace App\Providers;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Illuminate\Support\ServiceProvider;
use App\Http\Middleware\CaptureRequestExtension;
class AppServiceProvider extends ServiceProvider
jrmadsen67 / gist:bd0f9ad0ef1ed6bb594e
Last active Jan 19, 2021
Laravel Quick Tip: Handling CsrfToken Expiration gracefully
View gist:bd0f9ad0ef1ed6bb594e
Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if
a form sits there for a while (like a login form, but any the same) the csrf token in the form will
expire & throw a strange error.
Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner.
In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T!
Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function.
All of your exceptions go through here, unless you have excluded them in the $dontReport array at the

All binary can be downloaded

Sublime Text 3, build 3083 (dev) for Windows x64

0xe21b3 85 3B


pburtchaell / styles.css
Last active Mar 1, 2021
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
View styles.css
* VH and VW units can cause issues on iOS devices:
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
* iOS Resolution Quick Reference:
ck-on / hhvminfo.php
Last active Mar 18, 2020
HHVMinfo - phpinfo for HHVM HipHop Virtual Machine
View hhvminfo.php
HHVMinfo - phpinfo page for HHVM HipHop Virtual Machine
Author: _ck_
License: WTFPL, free for any kind of use or modification, I am not responsible for anything, please share your improvements
Version: 0.0.6
* revision history
0.0.6 2014-08-02 display fix for empty vs zero
0.0.5 2014-07-31 try to determine config file from process command line (may not always work), style improvements
vertexclique /
Last active Feb 25, 2021
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )


Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

View utc_offset_list.txt
Time offset Example time(ISO 8601 notation) Example locations
=========== =============================== =================
UTC−12:00 2014-03-14T20:19:12-12:00 Baker Island, Howland Island (both uninhabited)
UTC−11:00 2014-03-14T21:19:12-11:00 American Samoa, Niue
UTC−10:00 2014-03-14T22:19:12-10:00 United States (Hawaii)
UTC−09:30 2014-03-14T22:49:12-09:30 Marquesas Islands
UTC−09:00 2014-03-14T23:19:12-09:00 Gambier Islands
UTC−07:00 2014-03-15T01:19:12-07:00 Canada (northeastern British Columbia), Mexico (Sonora), United States (Arizona)
UTC−06:00 2014-03-15T02:19:12-06:00 Canada (almost all of Saskatchewan), Costa Rica, El Salvador, Ecuador (Galápagos Islands), Guatemala, Honduras, Mexico (most), Nicaragua
#!/usr/bin/env bash
curl --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
corny / git.cap
Created Nov 14, 2013
Capistrano 3 with Git Submodules
View git.cap
# Save this file as lib/capistrano/tasks/git.cap
namespace :git do
desc 'Copy repo to releases'
task create_release: :'git:update' do
on roles(:all) do
with fetch(:git_environmental_variables) do
within repo_path do
execute :git, :clone, '-b', fetch(:branch), '--recursive', '.', release_path