Skip to content

Instantly share code, notes, and snippets.

<?php
namespace App\Utils;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Class ProgressIndicator.
*/
class ProgressIndicator
@imiroslavov
imiroslavov / .gitattributes
Created October 16, 2019 14:46
codingstyle
# Autodetect text files
* text=auto
# Force the following filetypes to have unix eols, so Windows does not break them
*.* text eol=lf
# Force images/fonts to be handled as binaries
*.jpg binary
*.jpeg binary
*.gif binary
<?php
namespace App;
class Lazy
{
private $handler;
public function __construct(callable $handler)
{
<?php
class Foo {}
function castToObject($object, $className)
{
return unserialize(
sprintf(
'O:%d:"%s"%s',
strlen($className),
<?php
class Panic extends Exception {}
function defer(?array &$context, callable $callback)
{
$context[] = new class($callback) {
private $callback;
public function __construct($callback)
{
var Encore = require('@symfony/webpack-encore');
Encore
...
.configureLoaderRule('scss', (options) => {
options.oneOf.forEach((entry) => {
entry.use.forEach((config) => {
if ('resolve-url-loader' === config.loader) {
<?php
namespace App\Process;
/**
* Class BackgroundProcess.
*/
class BackgroundProcess
{
/**
#!/usr/bin/env bash
gource \
-s .06 \
-1280x720 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-at-end \
--key \
--highlight-users \
<?php
$handle = fopen(__FILE__, 'r');
fseek($handle, __COMPILER_HALT_OFFSET__);
$request = stream_get_contents($handle);
fclose($handle);
var_dump($request);
__halt_compiler();
{
<?php
namespace Deployer;
require 'vendor/deployer/deployer/recipe/symfony4.php';
use \Symfony\Component\Dotenv\Dotenv;
$project_config = '.env.local';
$web_server = 'nginx';