Skip to content

Instantly share code, notes, and snippets.

View imiroslavov's full-sized avatar

Iliya Miroslavov Iliev imiroslavov

  • Varna, Bulgaria
View GitHub Profile
@imiroslavov
imiroslavov / tvheadend-fetch.js
Created November 10, 2020 15:51 — forked from tryvin/tvheadend-fetch.js
TVHeadend JS functions to help handling some copy
function getAllMuxes() {
return fetch('/api/mpegts/mux/grid',
{
body: 'start=0&limit=999999999&sort=name&dir=ASC', method: 'POST',
credentials: 'include',
headers: {
'Accept': 'application/json, application/xml, text/plain, text/html, *.*',
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
}
}
<?php
namespace App\Cache;
use App\Service\RouteMapService;
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RouterInterface;
/**
@imiroslavov
imiroslavov / SomeHydrator.php
Last active March 2, 2020 14:37
Custom doctrine hydrator
<?php
namespace App\Doctrine\ORM\Hydration;
use App\Entity\User;
use Doctrine\ORM\Internal\Hydration\ObjectHydrator;
class SomeHydrator extends ObjectHydrator
{
/**
<?php
namespace App\Repository;
use App\Entity\SomeEntity;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
class SomeEntityRepository extends ServiceEntityRepository
{
There are a lot of complaints going around about Laravel these days, but a lot
of the important ones seem to be missing from the spotlight.
Bugfixes, issues and pull requests being left open for months with no
clarification of intent:
- https://github.com/laravel/framework/pull/1799
- https://github.com/laravel/framework/issues/1963
- https://github.com/laravel/framework/issues/2089
- https://github.com/laravel/framework/issues/2234
#!/usr/bin/env bash
MATCH=$(git diff --staged | grep -E "(dd|dump)\(.*\)")
if [[ ! -z "$MATCH" ]]; then
echo "Detected a dd()|dump() in one of your files. Aborting commit!"
echo "$MATCH"
exit 1
fi
#!/usr/bin/env bash
if [ "$#" -ne 2 ]; then
echo "Usage: ./update.sh <branch> <environment>"
exit 1
fi
BRANCH=${1}
export APP_ENV=${2}
<VirtualHost *:80>
ServerName hostname
DocumentRoot /path/to/web
DirectoryIndex app.php
<Directory /path/to/web>
Require all granted
AllowOverride None
</Directory>
@imiroslavov
imiroslavov / Configuration.php
Created November 13, 2019 13:56 — forked from xphere/Configuration.php
Recursive symfony/configuration
<?php
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* Helper function to create recursive nodes
*/
function recursiveNode(string $name, callable $callback)
@imiroslavov
imiroslavov / limits.conf
Created October 29, 2019 08:58
Attempt to scale a local machine to handle 60k+ open connections
# /etc/security/limits.conf
* soft nofile 1000000
* hard nofile 1000000