Skip to content

Instantly share code, notes, and snippets.

View miguelzinhe's full-sized avatar

miguel miguelzinhe

  • Brazil
View GitHub Profile
@miguelzinhe
miguelzinhe / like-btn.js
Created April 30, 2020 22:59
Challenge C*d*l*ty Like
import classNames from 'classnames'
import { Component } from 'react'
export default class LikeButton extends Component {
constructor(props) {
super(props);
this.state = { liked: false, count: 100 };
}
onClickAddLikeHandler = () => {
@miguelzinhe
miguelzinhe / candidates-api.js
Created April 30, 2020 22:57
Challenge Cod*l*ty API
'use strict'
const express = require('express')
const app = express()
app.use(express.json())
const candidates = []
const sortSkillsMatchCount = (firstCandidate, secondCandidate) => {
if (firstCandidate.matchCount < secondCandidate.matchCount) {
@miguelzinhe
miguelzinhe / unfollow.js
Created October 20, 2019 01:03 — forked from JamieMason/unfollow.js.md
Unfollow everyone on twitter.com
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
// 1. Go to https://twitter.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
(() => {
const followButtonQuery = '[data-testid$="-unfollow"]';
const confirmButtonQuery = '[data-testid="confirmationSheetConfirm"]';
const sleep = ({ seconds }) =>
@miguelzinhe
miguelzinhe / index.js
Created September 17, 2019 01:47
Array to Object - JavaScript/ES6+
const array1 = [
{
"titulo1":"NEW YORK",
"titulo2":"Why?",
},
]
const array2 = [
{
"titulo3":"What?",
@miguelzinhe
miguelzinhe / front-end-code-review-checklist.md
Last active April 22, 2019 17:36
Front-end Code Review Checklist - PT-Br

Formatação

  • Tem algum erro no console após entrar na página em que o componente está localizado?
  • Está passando nas regras do eslint e do stylelint?
  • Tem código comentado?
  • O código ultrapassa mais de 80 colunas no editor?
  • Há algum código com mais de 2 linhas vazias na quebra de linha?

Arquitetura

  • O código se repete (DRY)?

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@miguelzinhe
miguelzinhe / hotels.py
Last active March 16, 2021 17:17
hotels
#!/usr/bin/python
hoteis = [
{
"nome" : "Lakewood",
"classificacao" : 3,
"regular" : {
"dia_da_semana" : 110,
"fim_de_semana" : 90,
},