Skip to content

Instantly share code, notes, and snippets.

View joubertredrat's full-sized avatar

Joubert RedRat joubertredrat

View GitHub Profile
@joubertredrat
joubertredrat / MyCoolRepository.php
Created April 2, 2018 13:33
Doctrine custom walker
<?php
namespace Application\Infrastructure\Repository;
use Application\Domain\Model\TransactionStatus;
use Application\Infrastructure\Component\DoctrineExtensions\Query\SortableNullsWalker;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query;
/**
<?php
/**
* Define your slack group
*/
$slackGroup = '';
/**
* Define your slack token
* @see https://api.slack.com/docs/oauth-test-tokens
@joubertredrat
joubertredrat / readme.md
Created December 6, 2017 16:35
Firefox downgrade on Ubuntu 16.04

1 - Get older Firefox version (56)

i386 version - x86_64 version

2 - Install application

sudo dpkg -i firefox_56.0+build6-0ubuntu1_i386.deb

or

<?php
class Foo
{
const BAR_ONE = 1;
const BAR_TWO = 2;
const BAR_THREE = 3;
const QUX_1 = 'one';
const QUX_2 = 'two';
const QUX_3 = 'three';
@joubertredrat
joubertredrat / output.log
Created December 21, 2016 16:58
Digital Ocean and your bizarre crazy flat shared private networking
root@test2:~# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 76:85:75:73:d4:31
inet addr:10.132.95.40 Bcast:10.132.255.255 Mask:255.255.0.0
inet6 addr: fe80::7485:75ff:fe73:d431/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63 errors:0 dropped:0 overruns:0 frame:0
TX packets:68 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8841 (8.8 KB) TX bytes:7369 (7.3 KB)
@joubertredrat
joubertredrat / issue.md
Created December 20, 2016 19:21
Single quotes on mysql reserved keywords in schema creation

Hi guys,

I'm testing Schema from DBAL and I discovered this problem below:

<?php
require(__DIR__.'/vendor/autoload.php');

$schema = new \Doctrine\DBAL\Schema\Schema();
$products = $schema->createTable('products');
@joubertredrat
joubertredrat / result-expected.sql
Created December 20, 2016 18:30
Doctrine DBAL Schema possible bug
CREATE TABLE products (
date_insert DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT 'Insert date',
date_update DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT 'Last change date'
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
<?php
try {
/* ... */
} catch (MyException $_) {
header('Location: /error/');
}
.install form label {
text-align: right;
width: 320px !important;
}
.install form input {
width: 35% !important;
}
.install form .field {
text-align: left;
}
@joubertredrat
joubertredrat / readme.md
Last active October 14, 2016 17:27
PHP RFC: Option to validate decimal digits in filter_var();

PHP RFC: Option to validate decimal digits in filter_var();

  • Version: 0.1
  • Date: 2016-10-14
  • Author:
  • Status: Concept
  • First Published at: Github gist

Introduction