Skip to content

Instantly share code, notes, and snippets.

@henriquemoody
henriquemoody / pt_BR.php
Last active December 6, 2024 15:14
Translate Respect\Validation messages with OpenAI
<?php
declare(strict_types=1);
return [
'{{name}} must be an infinite number' => '{{name}} deve ser um número infinito',
'{{name}} must not be an infinite number' => '{{name}} não deve ser um número infinito',
'{{name}} must be a valid email address' => '{{name}} deve ser um endereço de e-mail válido',
'{{name}} must not be an email address' => '{{name}} não deve ser um endereço de e-mail',
'{{name}} must be a perfect square number' => '{{name}} deve ser um número quadrado perfeito',
#!/usr/bin/env bash
set -euo pipefail
declare -r IFS=$'\n'
declare -r SPAWNED_LIST=$(mktemp)
declare -r SPAWNED_LIMIT=20
task() {

How to facilitate a retrospective

The role of Facilitator is fundamental for almost every meeting. The Facilitator ensures that the whole group is empowered to make decisions and that every individual has their voice heard.

During a retrospective, the Facilitator role is crucial. In a retrospective, it is ideal that everyone has at least some degree of participation, and it is the Facilitator that helps the participants with that.

<?php
// Based on https://stackoverflow.com/questions/965611/forcing-access-to-php-incomplete-class-object-properties
function convertObject($object, string $from, string $to)
{
// Serialize
$serialized = serialize($object);
// Replace the object-type
$objectReplaced = preg_replace(
#!/usr/bin/env bash
# Usage: {script} PATH
# Construct a commit message for use with rebase --autosquash.
#
# The commit message will be the subject line from the specified commit with a
# prefix of "fixup! " and will contain the changes on the PATH.
#
# --help, -h Displays this help
#
# Report bugs to Henrique Moody <henriquemoody@gmail.com>
@henriquemoody
henriquemoody / br-cities.php
Last active June 1, 2020 12:50
Lista de cidades brasileiras com base nos dados o IBGE
<?php
return [
// http://www.cidades.ibge.gov.br/download/mapa_e_municipios.php?uf=ac (Thu May 14 16:30:15 BRT 2015)
'AC' => [
1200013 => 'Acrelândia',
1200054 => 'Assis Brasil',
1200104 => 'Brasiléia',
1200138 => 'Bujari',
1200179 => 'Capixaba',
@henriquemoody
henriquemoody / http-status-codes.php
Last active July 30, 2024 10:29
List of HTTP status codes in PHP
<?php
/**
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
*
* You may also want a list of unofficial codes:
*
* 103 => 'Checkpoint',
* 218 => 'This is fine', // Apache Web Server
* 419 => 'Page Expired', // Laravel Framework
@henriquemoody
henriquemoody / nl_langinfo.php
Last active December 20, 2015 06:59
nl_langinfo() constant values.
<?php
$langinfo = array(
'LC_TIME' => array(
'ABDAY_1' => 'Abbreviated name of fist day of the week',
'ABDAY_2' => 'Abbreviated name of second day of the week',
'ABDAY_3' => 'Abbreviated name of third day of the week',
'ABDAY_4' => 'Abbreviated name of fourth day of the week',
'ABDAY_5' => 'Abbreviated name of fifth day of the week',
'ABDAY_6' => 'Abbreviated name of sixth day of the week',
# Bash-Completion script for PHPUnit
#
# Created by Henrique Moody <henriquemoody@gmail.com>
#
_phpunit()
{
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"
@henriquemoody
henriquemoody / rename-by-date.bash
Last active December 10, 2015 03:58
Rename files by date. (OSX, only)
#!/usr/bin/env bash
# Usage: {script} FILE1 FILE2 ...
#
# --help, h Displays this help
#
# Report bugs to Henrique Moody <henriquemoody@gmail.com>
#
_help()
{