Skip to content

Instantly share code, notes, and snippets.

Avatar

Joubert RedRat joubertredrat

View GitHub Profile
@joubertredrat
joubertredrat / howto.md
Created Jun 12, 2020 — forked from petrkohut/howto.md
How to have redis-cli and psql installed on machine using Docker
View howto.md

How to install redis-cli and psql client on your machine with Docker

Preparing docker images

We will use minimalistic Linux distribution called Alpine (5MB)

Dockerfile of redis-cli

FROM alpine:latest
RUN apk --update add redis
@joubertredrat
joubertredrat / readme.md
Last active Sep 26, 2019
Regras do concurso cosplay na escola E.E Professor João Câmara
View readme.md

Concurso cosplay na escola E.E Professor João Câmara

Regras

  • A inscrição deverá ser feita pelo formulário online .
  • É necessário enviar pelo menos uma foto do personagem de referência.
  • O cosplay será avaliado por 2 critérios, fidelidade e desenvoltura na apresentação por 3 pessoas juradas.
  • O cosplayer terá 1 minuto para realizar sua apresentação, o cosplayer que exceder este tempo será penalizado.

Premiação

@joubertredrat
joubertredrat / test.php
Last active Sep 19, 2019
A bizarre mock that works
View test.php
<?php
namespace Tests;
use GuzzleHttp\Client;
use Tests\TestCase;
/**
* Any Test
*
View arrumar-zona.sh
#!/usr/bin/env bash
l=$(wmctrl -l | grep -i -o "0[xX][0-9a-z]*")
for i in $(echo $l); do
wmctrl -i -r $i -b toggle,maximized_horz,maximized_vert
done
for i in $(echo $l); do
wmctrl -i -r $i -b toggle,maximized_horz,maximized_vert
@joubertredrat
joubertredrat / index.php
Created Aug 9, 2019
encrypt decrypt test
View index.php
<?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 Mar 27, 2019
File with configuration for overwritten on istio install by helm
View values.yml
gateways:
istio-ingressgateway:
serviceAnnotations:
"service.beta.kubernetes.io/aws-load-balancer-internal": "0.0.0.0/0"
@joubertredrat
joubertredrat / example.php
Last active Jan 22, 2019
PHP RFC: array_element_exists function
View example.php
<?php
require('polyfill.php');
$array = ['a', 'A', 'A', 'A', 'a', 't'];
var_dump(
array_element_exists('a', $array),
array_element_exists('x', $array)
);
View file.md
/**
 * @return array
 */
public function toArray(): array
{
    return [
        'id' => $this->customer->getId(),
        'account' => [
            'id' => $this->customer->getAccount()->getId(),
View MyCoolRepository.php
<?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;
/**
View slack-auto-invite.php
<?php
/**
* Define your slack group
*/
$slackGroup = '';
/**
* Define your slack token
* @see https://api.slack.com/docs/oauth-test-tokens