Skip to content

Instantly share code, notes, and snippets.

@Invis1ble
Invis1ble / rxjs-diagrams.md
Created Dec 26, 2018 — forked from PCreations/rxjs-diagrams.md
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@Invis1ble
Invis1ble / torrc
Created Sep 4, 2018
tor node blacklist
View torrc
ExcludeNodes {ru},{by},{am},{kz},{uz},{rs},{ir},{??}
ExcludeExitNodes {ru},{by},{am},{kz},{uz},{rs},{ir},{ua},{??}
@Invis1ble
Invis1ble / AppBundle.php
Last active Nov 23, 2017
Disable Symfony 3.3 AclVoter
View AppBundle.php
<?php
namespace AppBundle;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use AppBundle\DependencyInjection\Compiler\DisableAclVoterPass;
@Invis1ble
Invis1ble / http-service-watchdog.php
Created Sep 6, 2017
Node.js HTTP service watchdog
View http-service-watchdog.php
#!/usr/bin/env php
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
set_time_limit(0);
@Invis1ble
Invis1ble / TimezoneType.php
Last active Mar 25, 2017 — forked from mylk/TimezoneType.php
A modified Symfony Forms "timezone" type that also displays the timezone offset
View TimezoneType.php
<?php
/**
* A modified version of the original symfony form type that adds the timezone offset.
*
* Original version at:
* https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php
*/
/*
* Installation:
@Invis1ble
Invis1ble / regexp-date-validation.php
Last active Mar 15, 2017
Regular expression for date validation. Just for fun.
View regexp-date-validation.php
$pattern =
'/^
# year
(?!0000)\pN{2}(?:(
(?:
# leap year
([02468])|[13579])(?(2)[048]|[26]))(?(?<=00)(?(?<=[02468].{3})(?<=[048].{2})|(?<=[26].{2})))|
# non-leap year
\pN{2}
)
@Invis1ble
Invis1ble / MenuBuilder.php
Last active Mar 3, 2020 — forked from nateevans/MenuBuilder.php
KNP Menu Bundle with Bootstrap 3 and Font Awesome 4 (+ fixed several bugs)
View MenuBuilder.php
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
@Invis1ble
Invis1ble / check-ip.php
Last active Jan 21, 2017
Small console script for checking IP address
View check-ip.php
#!/usr/bin/env php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
set_time_limit(0);
$triesNumber = 5;
$timeout = 5;
@Invis1ble
Invis1ble / Twig\Node\Module.php
Created Aug 19, 2014
Twig compiler tweak: shows name of rendered template
View Twig\Node\Module.php
protected function compileDisplayBody(Twig_Compiler $compiler)
{
$filename = $this->getAttribute('filename');
$compiler->write("echo '<!-- START " . $filename . (null !== $this->getNode('parent') ? " (has parent)" : '') . " -->';\n");
$compiler->subcompile($this->getNode('body'));
if (null !== $this->getNode('parent')) {
if ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) {
$compiler->write("\$this->parent");
} else {
View SwiftmailerDoubleDotBugCase
<?php
require_once './vendor/autoload.php';
$username = '%username%';
$password = '%password%';
$to = '%to%';
$body =
<<<BODY