Skip to content

Instantly share code, notes, and snippets.

View joubertredrat's full-sized avatar

Joubert RedRat joubertredrat

View GitHub Profile
@joubertredrat
joubertredrat / index.php
Created August 9, 2019 21:21
encrypt decrypt test
<?php
$publicKeyString = "-----BEGIN PUBLIC KEY-----
-----END PUBLIC KEY-----";
$privateKeyString = "-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----";
$publicKey = openssl_pkey_get_public($publicKeyString);
@joubertredrat
joubertredrat / values.yml
Last active March 27, 2019 22:09
File with configuration for overwritten on istio install by helm
gateways:
istio-ingressgateway:
serviceAnnotations:
"service.beta.kubernetes.io/aws-load-balancer-internal": "0.0.0.0/0"
@joubertredrat
joubertredrat / example.php
Last active January 22, 2019 20:41
PHP RFC: array_element_exists function
<?php
require('polyfill.php');
$array = ['a', 'A', 'A', 'A', 'a', 't'];
var_dump(
array_element_exists('a', $array),
array_element_exists('x', $array)
);
/**
 * @return array
 */
public function toArray(): array
{
    return [
        'id' => $this->customer->getId(),
        'account' => [
            'id' => $this->customer->getAccount()->getId(),
<?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