Skip to content

Instantly share code, notes, and snippets.

View RodrigoPauletti's full-sized avatar
💻
Coding

Rodrigo Pauletti RodrigoPauletti

💻
Coding
View GitHub Profile
@martyf
martyf / TagTestBlink.php
Created February 9, 2024 06:00
Test Tags to demonstrate the performance gains of using Blink in Statamic
@rponte
rponte / using-uuid-as-pk.md
Last active May 2, 2024 11:01
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@daugaard47
daugaard47 / Livewire Intervention Image File Upload
Created August 18, 2020 04:48
Upload images with Livewire and compress with Intervention Image.
//HTML
<div class="avatar-file">
<label class = "text-bh-navy-500">Choose Image</label>
<input type = "file" wire:model = "avatar">
</div>
//LW Component
use WithFileUploads;
public $avatar;
@maykbrito
maykbrito / index.html
Last active January 27, 2024 00:51
WS special hands on! - Texto dia 1
<p>
Ficar em casa em períodos longos, não deve ser nada fácil.
</p>
<p>
Iremos catalogar ideias, brincadeiras, jogos, filmes, livros, cursos, dicas e tudo que for necessário para tornar esse momento mais interessante.
</p>
<p>
Comece clicando em ver ideias para ver as ideias cadastradas e contribua adicioando a sua ideia.
</p>
@8ctopotamus
8ctopotamus / react-var_dump.js
Last active October 18, 2023 17:34
Display data in React, kinda like PHP's var_dump();
const dataDump = props => <pre>{JSON.stringify(props, null, 2)}</pre>
@max10rogerio
max10rogerio / yup.locale.pt-br.js
Last active August 23, 2023 17:43
Translation of the main messages from the Yup library into the Pt-Br language.
/* eslint-disable */
// For more infos, see: https://github.com/jquense/yup/blob/master/src/locale.js
import { setLocale } from 'yup'
const translation = {
mixed: {
default: '${path} é inválido',
required: '${path} é um campo obrigatório',
oneOf: '${path} deve ser um dos seguintes valores: ${values}',
notOneOf: '${path} não pode ser um dos seguintes valores: ${values}',
@felipecarvalho
felipecarvalho / codes.json
Last active February 26, 2023 17:09
JSON list with country and phone codes in portuguese [PT-BR]
[
{
"dialCode": "93",
"code": "AFG",
"label": "Afeganistão"
},
{
"dialCode": "355",
"code": "ALB",
"label": "Albânia"
@joaorobertopb
joaorobertopb / srp-solid-functions-example.php
Created December 31, 2018 02:03
Princípio da responsabilidade única do SOLID sendo aplicando na refatoração de uma função.
<?php
//Ruim:
function emailClients(array $clients): void
{
foreach ($clients as $client) {
$clientRecord = $db->find($client);
if ($clientRecord->isActive()) {
email($client);
}
@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@fxmontigny
fxmontigny / get-set-html-quilljs-editor.js
Last active March 20, 2024 16:27
Insert and get html content with quilljs editor
const editor = $('.editor');
const quill = new Quill(editor);
// set html content
quill.setHTML = (html) => {
editor.root.innerHTML = html;
};
// get html content