Skip to content

Instantly share code, notes, and snippets.

View pierredup's full-sized avatar
🐢
squirreling

Pierre du Plessis pierredup

🐢
squirreling
View GitHub Profile
@pierredup
pierredup / AppBundle.php
Created August 21, 2018 21:10
Track class for changes to rebuilt container
<?php
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AppBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
// Any changes to the MyConfig class will trigger the container cache to be rebuilt
<?php
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AppBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
@pierredup
pierredup / tslint.json
Created August 7, 2018 07:13
Standard TSLint Config
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended",
"tslint-eslint-rules"
],
"rules": {
"array-type": [true, "array-simple"],
"adjacent-overload-signatures": true,
"arrow-parens": true,
@pierredup
pierredup / filter.php
Created April 3, 2018 06:37
Lodash-PHP filter methhod
<?php
use function _\filter;
$users = [
[ 'user' => 'barney', 'age' => 36, 'active' => true],
[ 'user' => 'fred', 'age' => 40, 'active' => false]
];
filter($users, 'active');
@pierredup
pierredup / filter.php
Created April 3, 2018 06:35
Lodash-PHP example functions
<?php
use function _\filter;
$users = [
[ 'user' => 'barney', 'age' => 36, 'active' => true],
[ 'user' => 'fred', 'age' => 40, 'active' => false]
];
filter($users, 'active');
Verifying my Blockstack ID is secured with the address 1GS9jHSeEYRXaSjB3TGd6AAeisDrnQA2Fu https://explorer.blockstack.org/address/1GS9jHSeEYRXaSjB3TGd6AAeisDrnQA2Fu

Keybase proof

I hereby claim:

  • I am pierredup on github.
  • I am pierredup (https://keybase.io/pierredup) on keybase.
  • I have a public key ASDMF_1b6u479I1Q-nqDCw-IZJBJXcgKg3iM-2WyQq_z1Qo

To claim this, I am signing this object:

@pierredup
pierredup / default.vcl.diff
Last active November 20, 2015 20:44
Magento Varnish 4.0
diff --git a/app/code/community/Phoenix/VarnishCache/etc/default_3.0.vcl b/app/code/community/Phoenix/VarnishCache/etc/default_3.0.vcl
index fdef368..4581460 100755
--- a/app/code/community/Phoenix/VarnishCache/etc/default_3.0.vcl
+++ b/app/code/community/Phoenix/VarnishCache/etc/default_3.0.vcl
@@ -1,5 +1,6 @@
# This is a basic VCL configuration file for PageCache powered by Varnish for Magento module.
+vcl 4.0;
# include variable handling methods
include "vars.vcl";
@pierredup
pierredup / benchmark.php
Created October 15, 2014 15:51
SplMinHeap and SplMaxHeap Benchmark
<?php
// Generate random numbers
// Assume this is our info that we get from a CSV file or somewhere else
$collection = array();
for ($i = 0; $i < 1000000; $i++) {
$collection[] = rand(1, 1000000);
}
<?php
class AdapterFactory
{
private $adapters = [];
public function registerAdapter($name, callback $adapterFactory, callback $adapterConfigurator
{
$this->adapter[$adapter] = [$adapterFactory, $adapterConfigurator];
}