Skip to content

Instantly share code, notes, and snippets.

Avatar

Joubert RedRat joubertredrat

View GitHub Profile
@joubertredrat
joubertredrat / .editorconfig
Last active Nov 28, 2021
Editorconfig and gitignore for go projects
View .editorconfig
root = true
[*]
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
[{Makefile,go.mod,go.sum,*.go}]
@joubertredrat
joubertredrat / git-clone-github
Created Nov 18, 2021
Clone a Github repository into a new directory with user as prefix
View git-clone-github
#!/bin/sh
# git-clone-github
# Clone a Github repository into a new directory with user as prefix
# Usage: git clone-github github-repo-url
set -e
clone_url=$1
if [[ $clone_url != https://github.com/* && $clone_url != http://github.com/* ]]
then
@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' =&gt; $this-&gt;customer-&gt;getAccount()-&gt;getId(),