Skip to content

Instantly share code, notes, and snippets.

View matheusazzi's full-sized avatar

Matheus Azzi matheusazzi

View GitHub Profile
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@matheusazzi
matheusazzi / oportunidades_codeminer42.md
Created August 26, 2019 13:50 — forked from guivinicius/oportunidades_codeminer42.md
[Diversos] Vagas para Back-end e Front-end na Codeminer42

Descrição da vaga


Buscamos developers para atuar em diversos projetos, inclusive projetos internacionais com clientes estrangeiros. Temos diversos projetos, com diversos frameworks e tecnologias, então entre em contato. Estamos procurando pessoas de todo os níveis para fazer parte de nosso time, sem diferenças nem preferências. Todos são bem vindos.

Local


A Codeminer42 está presente atualmente em mais de 10 locais do país. Temos vagas para todos eles.

@matheusazzi
matheusazzi / Button.jsx
Last active May 13, 2022 19:33
Button.jsx
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import styles from './button.module.css'
const cx = classnames.bind(styles)
const defaultProps = {
as: 'default',
shape: 'rect',

Code Smells

  • Long Method
  • Large Class
  • Feature Envy
  • Case/Switch Statement
  • High Fan-out
  • Shotgun Surgery
  • Divergent Change
  • Long Parameter List
@matheusazzi
matheusazzi / example.clj
Created November 13, 2017 23:25
example.clj
(def tags ["1.0.0" "1.0.1" "1.0.2" "1.1.0" "1.1.2" "1.2.2"])
(defn remove-dots [tag]
(clojure.string/replace tag "." ""))
(defn to-int [s]
(Integer/parseInt s))
(defn between-versions? [n]
(and (> n 101) (< n 120)))
@matheusazzi
matheusazzi / poker.ex
Last active July 20, 2017 17:12
poker.ex
defmodule Poker do
## Rank a poker hand
##
## Card is {:suit, value}, e.g. {:heart, 3}
## Hand is a list of 5 cards
##
## Poker.rank [{:heart, 10}, {:club, 11}, {:heart, 9}, {:diamond, 12}, {:heart, 13}]
## >> :straight
def rank(hand) do
@matheusazzi
matheusazzi / .iex.exs
Created July 16, 2017 22:50
.iex.exs
IEx.configure [
colors: [
pretty: true,
syntax_colors: [
atom: :light_cyan,
string: :light_green,
number: :light_blue,
nil: :light_magenta,
list: :light_white,
tuple: :light_white,
# frozen_string_literal: true
class Things::Something
Result = Data.define(:thing, :errors) do
def initialize(thing: nil, errors: [])
super
end
def successful?
errors.empty?
@matheusazzi
matheusazzi / button.md
Last active November 27, 2016 03:11
button.md

UI Button Component:

<template>
  <button
    :type="buttonType"
    :class="classes"
    :disabled="isDisabled"
    :autofocus="autofocus"
    @click="action">
@matheusazzi
matheusazzi / promise-observer.js
Last active October 16, 2020 20:11
promise-observer.js
function RenderAndOrderByName() { console.log('Ordenado por nomes') }
function RenderAndOrderByAge() { console.log('Ordenado por idades') }
// Retorna uma Promise
function getUsers() {
// Apenas faz um request para uma lista de users,
// a ordenação é feita no client
}
// Depois que a promise terminar, ordena eles por nome.