StackPHP – HttpKernelInterface based middlewares

The HttpKernelInterface models web request and response as PHP objects, giving them value semantics. Stack is a convention for composing HttpKernelInterface middlewares. By wrapping your application in decorators you can add new behaviour from the outside. In the screenshot above Session is a decorator wrapped around Authentication which itself is a decorator wrapped around the …

Easy Textures with CSS Masks

.grit { -webkit-mask-image: url(“grit.png”); mask-image: url(“grit.png”); } With the image above, the areas with partial and full transparency will mask the element (allowing the background to show through), while fully opaque areas (of any color) will allow the element to be visible. Then simply apply it as a mask image in CSS with only 2 …

Polylion: SVG polygon animation

Using a tad of JavaScript it iterates all <polygon> elements of the SVG and animates them using TimelineMax. It’s also possible without TimelineMax, by using a CSS animation, and by changing animation-delay per <polygon>. // SCSS @keyframes polyonlion-animation { to { transform: scale(1); opacity: 1; } } .polyonlion > g polygon { transform: scale(0); transform-origin: …

Recommended Reading: Modern PHP

PHP is experiencing a renaissance, though it may be difficult to tell with all of the outdated PHP tutorials online. With this practical guide, you’ll learn how PHP has become a full-featured, mature language with object-orientation, namespaces, and a growing collection of reusable component libraries. Author Josh Lockhart—creator of PHP The Right Way, a popular …

PHP Scalar Type Hints, Follow-up

The vote for the RFC “PHP Scalar Type Hints” got cancelled, after the author of the RFC – Andrea Faulds – posted “I Quit” on the internals list: For my own reasons, I have decided to cease my involvement with PHP development. […] I’m no longer contributing to PHP, and all four active RFCs authored …

Compositing And Blending In CSS

Before the Compositing and Blending specification was introduced, CSS allowed one type of composite operations: simple alpha compositing. This is what the opacity property is for. By changing an element’s opacity, the browser makes it translucent so that the colors of its backdrop can show through. Today, two main properties exist that allow us to …

Deployment with Envoy

// Contents of Envoy.blade.php @servers(['web' => 'deploy-ex']) <?php $repo = '[email protected]:Servers-for-Hackers/deploy-ex.git'; $release_dir = '/var/www/releases'; $app_dir = '/var/www/app'; $release = 'release_' . date('YmdHis'); ?> @macro('deploy', ['on' => 'web']) fetch_repo run_composer update_permissions update_symlinks @endmacro @task('fetch_repo') [ -d {{ $release_dir }} ] || mkdir {{ $release_dir }}; cd {{ $release_dir }}; git clone {{ $repo }} {{ $release …