Skip to content

Instantly share code, notes, and snippets.

👃
Interested in Code Smells

Élisson Michael elissonmichael

👃
Interested in Code Smells
Block or report user

Report or block elissonmichael

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@elissonmichael
elissonmichael / pilha_dinamica.c
Last active Jun 17, 2019
Estrutura de Dados - Pilha Estática vs Dinâmica & Palíndromo
View pilha_dinamica.c
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int valor;
struct No *proximo;
} No;
typedef struct {
No *topo;
@elissonmichael
elissonmichael / test_mail_purge.rb
Created Jun 3, 2019 — forked from adamsanderson/test_mail_purge.rb
An example of using MiniTest::Mock
View test_mail_purge.rb
require 'minitest/mock'
require 'minitest/unit'
require 'date'
MiniTest::Unit.autorun
class TestMailPurge < MiniTest::Unit::TestCase
class MailPurge
def initialize(imap)
@imap = imap
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@elissonmichael
elissonmichael / brute_force.rb
Last active Apr 14, 2019
Algoritmo para Resolver uma Charada por Força Bruta em Ruby
View brute_force.rb
(100..999).each do |x|
(100..999).each do |y|
(100..999).each do |z|
soma = x + y + z
condicao1 = soma.digits.size == 3
condicao2 = soma.digits.uniq.size == 1
n = soma.digits.uniq.first
condicao3 = n == x.digits.first && n == y.digits.first && n == z.digits.first
condicao4 = x.digits.last == y.digits.last && y.digits.last == z.digits.last
condicao5 = x.digits[1] == y.digits[1] && y.digits[1] == z.digits[1]
View atom-ruby-snippets.cson
'.source.ruby':
'describe (String)':
'prefix': 'des'
'body': 'describe "${1:subject}" do\n $0\nend'
'describe (type)':
'prefix': 'dest'
'body': 'describe ${1:Type} do\n $0\nend'
'describe (type, string)':
'prefix': 'dests'
'body': 'describe ${1:Type}, "${2:description}" do\n $0\nend'
@elissonmichael
elissonmichael / inflections.rb
Created Aug 6, 2018 — forked from mateusg/inflections.rb
pt-BR inflections file for Ruby on Rails applications
View inflections.rb
# encoding: utf-8
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
@elissonmichael
elissonmichael / carrinho.rb
Last active Jun 26, 2018 — forked from rodrigomanhaes/carrinho.rb
Carrinho de Compras com Mock
View carrinho.rb
class Carrinho
attr_reader :pedidos
def initialize(args)
@pedido_class = args[:pedido_class]
@pedidos = []
end
def adicionar(produto)
@pedidos << @pedido_class.new(produto)
end
@elissonmichael
elissonmichael / capitulo1.rst
Created Jun 19, 2018 — forked from rodrigomanhaes/capitulo1.rst
Resumo do livro Agile Estimating and Planning, de Mike Cohn
View capitulo1.rst

AGILE ESTIMATING AND PLANNING

Mike Cohn

CHAPTER 1. The Purpose of Planning

Plans help to guide investment decisions (this project is worth to begin?), know who needs to be available to work on a project during a given period and know if a project is on track.

View agradecimento-rodrigo.rb
# -*- encoding : utf-8 -*-
#
# Rodrigo Soares Manhães, professor homenageado pelos formandos da turma de 2007
# do curso de Ciência da Computação da UENF.
#
# 20/09/2012
#
##
class Aluno < ActiveRecord::Base
@elissonmichael
elissonmichael / pt-BR.yml
Created Jun 17, 2018 — forked from bmentges/pt-BR.yml
will_paginate translation to portuguese
View pt-BR.yml
pt-BR:
will_paginate:
previous_label: "&#8592; Anterior"
next_label: "Pr&oacute;ximo &#8594;"
page_gap: "&hellip;"
page_entries_info:
single_page_html:
zero: "Nenhum registro encontrado"
one: "Apenas 1 registro encontrado"
other: "Mostrando todos os %{count} registros encontrados"
You can’t perform that action at this time.