Skip to content

Instantly share code, notes, and snippets.

View JorgeMadson's full-sized avatar

Jorge Madson JorgeMadson

View GitHub Profile
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Receitas do(a) (seu nome)</title>
<style>
body {
margin: 0;
@JorgeMadson
JorgeMadson / Ice&FireOfReact19.md
Last active August 5, 2024 18:51
What’s New in React 19: A Game of Thrones Saga

What’s New in React 19: A Game of Thrones Saga

Winter is coming, and so is React 19, with a flurry of new features that would make even the most stoic Starks crack a smile. Gather 'round the fire, dear developers, as we recount the tales of transitions, hooks, and the dreaded Server Components, all through the lens of Westeros.

The Battle of Actions

In the land of React, handling data mutations and updating state was once as cumbersome as defending the Wall from a horde of White Walkers. With React 18, developers had to juggle pending states, errors, and sequential requests like Jon Snow balancing his duty and love life.

// Before Actions
@JorgeMadson
JorgeMadson / rotate-image.js
Created July 14, 2021 18:24
How to rotate images in browser console
document.getElementsByTagName("img")[0].style.transform = "rotate(270deg)"
@JorgeMadson
JorgeMadson / READ.md
Last active January 31, 2023 22:49
Meu setup pra linux recem instalado

Dev Setup

  1. Run command: chmod +x dev-setup.sh
  2. Run command: ./dev-setup.sh to start the install script

Technical challenge

Here is the description of what you'll need to implement on this technical challenge.

Challenges

1. Cache function

Implement a function, class or module (it can be on the same file - request.py) to cache requests made with the existing code, preventing unecessary calls. You MUST use this Redis module as a cache service. Feel free to change the code within the existing functions, but do not alter their behaviour.

Context: Caching requests can be useful to avoid unecessary HTTP calls for the same resources, however, the resources can change during time, so it is important to keep in mind that cache needs to be invalidated at some point.

@JorgeMadson
JorgeMadson / brasil-sp-timezone.js
Created August 8, 2019 21:40
Data e hora em português com fuso horário de são paulo
new Date().toLocaleString('pt-BR', { timeZone: 'America/Sao_Paulo' });
@JorgeMadson
JorgeMadson / CuidadosMasculinos.md
Last active July 7, 2019 22:35
melhorando a autoestima masculina

Ajeitar a cara

Tem o canal do youtube do cara que foi por onde achei ele, mas tem um blog também é maneiro e organizado, ele ensina como cuidar da pele, cabelo e até o tal da harmonização facial que é o que faz o pessoal de hollywood tem aquele maxilar/mandibula bonita https://www.youtube.com/watch?v=JJXe0_3DJWA https://homensquesecuidam.com/

Ajeitar os dentes

Esse vídeo é bem vlog, mas mostra direitinho o processo pra ficar com os dentes lindos, o canal dessa cara não recomendo tanto pq ele divaga um pouco, mas dá algumas dicas https://www.youtube.com/watch?v=5uF_8CHb2bM

Moda

@JorgeMadson
JorgeMadson / hoursAgo.js
Last active June 26, 2019 14:13
Devolve uma data e hora menos algumas horas atrás
/*
O 19 é a quantidade de horas atrás, só subistituir por outro valor.
*/
new Date(new Date().setHours(new Date().getHours() - 19)).toLocaleString("pt-BR")
@JorgeMadson
JorgeMadson / README.md
Created April 8, 2019 02:23
Prototype of my aplication

TODO

Make an API to automatizate birthday wishes

First step

Connect with a virtual social network, get all friends birthday

Second

Let user choose what message he want to send to all birthday person

@JorgeMadson
JorgeMadson / README.md
Last active September 19, 2019 14:41
Cache in Python

Technical challenge

Here is the description of what you'll need to implement and answer on this technical challenge.

Challenges

You'll answer the 4 following challenges.

1. Cache function ✔️

Implement a function (on the same module - request.py) to cache requests preventing unecessary calls. You MUST use this Redis module as a cache service.