Skip to content

Instantly share code, notes, and snippets.

Avatar
🚫
undefined method `status' for nil:NilClass

Élisson Michael elissonmichael

🚫
undefined method `status' for nil:NilClass
View GitHub Profile
@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 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 / 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
@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 / rails http status codes
Created Oct 22, 2019 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
View rails http status codes
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
View commit-message-guidelines.md

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
You can’t perform that action at this time.