Skip to content

Instantly share code, notes, and snippets.

View AlyoshaS's full-sized avatar
:shipit:
No mínimo você aprende, no máximo você acerta (:

Evelyn Schmitz AlyoshaS

:shipit:
No mínimo você aprende, no máximo você acerta (:
View GitHub Profile
@sibelius
sibelius / testingConcept.md
Last active February 1, 2024 17:36
testing library concept and basic test

You first need to undestand the concept of frontend tests.

You should not test the implementation but the behavior

You test like the end user

For instance, imagine a login screen with email and password inputs and a submit button

The test should input the email and the password, then click in the submit button.

@BrunoMoreno
BrunoMoreno / RepoListHooks.js
Created November 16, 2019 03:18
A simple fetch with react hooks example.
import React, { Fragment, useState, useEffect } from 'react';
function RepoListHooks() {
const [repositories, setRepositories] = useState([]);
useEffect(() => {
async function getRepos() {
const response = await fetch('https://api.github.com/users/brunomoreno/repos');
@renatorib
renatorib / readme.md
Last active July 22, 2019 22:47
tgit

New working branch (feature, bug, etc)

tgit new fs/xyz [-b master]

git checkout master               # ensure we are on master branch  
git pull origin master --rebase   # ensure master is up to date (fetch upstream && rebase)
git checkout -b fs/xyz            # create the new src branch  
git push -u origin @              # should we auto push new src branches to remote?

I. Should we auto push new src branches to remote? Maybe a opt-in flag?

@andywer
andywer / _readme.md
Last active January 8, 2025 04:42
React - Functional error boundaries

React - Functional error boundaries

Thanks to React hooks you have now happily turned all your classes into functional components.

Wait, all your components? Not quite. There is one thing that can still only be implemented using classes: Error boundaries.

There is just no functional equivalent for componentDidCatch and deriveStateFromError yet.

Proposed solution

@heygrady
heygrady / refactoring-derived-state.md
Last active June 27, 2021 21:21
Refactoring derived state

How to refactor derived state

In our aging react code base we had been using componentWillRecieveProps for situations where we wanted to recalculate "stuff" when props change. Recent versions of react renamed this method to UNSAFE_componentWillRecieveProps for a variety of reasons. We recently went through an exercise where we tried to kill UNSAFE_componentWillRecieveProps once and for all.

The following is a contrived example of how to refactor such a component.

Step 1: How not to do it.

Here's a button component that uses UNSAFE_componentWillReceiveProps to keep its internal state in sync with the external props.

@swalkinshaw
swalkinshaw / tutorial.md
Last active February 26, 2025 21:15
Designing a GraphQL API
@marco-souza
marco-souza / 1.tools.md
Last active March 19, 2018 20:33
Ferramentas Nosebit

Ferramentas de Comunicação

Ferramenta Função Uso
Toby Compartilhamento de favoritos entre a equipe Instale a extensão e peça a um dos membros para te adicionar
zoom Melhor ferramenta de videoconferência gratuita Usado para reuniões de equipe, será enviado o link da sala antes de cada reunião