Skip to content

Instantly share code, notes, and snippets.

View italopaiva's full-sized avatar

Italo Paiva italopaiva

View GitHub Profile
-- Populando tabela de usuarios
INSERT INTO
usuarios(id, nome, email)
VALUES
(1, 'Jeromy Bradtke', 'lilian_stokes@huel.net'),
(2, 'Chance Koepp', 'brett_schmidt@oreilly.io'),
(3, 'Daron Wisoky', 'katharyn@emmerich.co'),
(4, 'Wynell Olson', 'kristal@frami.co'),
(5, 'Rodger Weissnat', 'johnie@carroll.net'),
# Essa lista representa o nosso conjunto de cartas.
# Nós abstraímos as cartas como um número inteiro positivo de 1 a 13.
cartas = [9, 3, 3, 10, 4, 5, 1, 7, 11, 10]
# Aqui seria uma lista de 10 cartas aleatórias
# Caso queira gerar uma lista aleatória, basta descomentar a linha abaixo.
# cartas = Array.new(10) { rand(1...13) }
puts "Essas são as cartas que estão no baralho: #{cartas}"
<template>
<q-page padding>
<q-input outlined v-model="novaTarefa" label="Descrição da tarefa" />
<q-btn
class="full-width q-mt-sm"
color="purple"
label="Adicionar nova tarefa"
@click="adicionarNovaTarefa()" />
@italopaiva
italopaiva / sublime-text-config.json
Last active May 6, 2019 02:36
JSON de configurações mínimas para o Sublime Text
{
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true,
"translate_tabs_to_spaces": true,
"index_files": true,
"tab_size": 2
}
<template>
<q-page padding>
<q-input
v-model="novaTarefa"
label="O que você precisa fazer hoje?" />
<q-btn outline
class="full-width"
color="primary"
<template>
<q-page class="flex flex-center">
<img alt="Quasar logo"
src="~assets/quasar-logo-full.svg"
@click="informarQueAImagemFoiClicada()">
</q-page>
</template>
@italopaiva
italopaiva / example.html
Created July 3, 2018 20:51
Exemplo de HTML com CSS e JavaScript
<html>
<head>
<meta charset="UTF-8">
<title>As 3 bases da Web</title>
</head>
<body>
<h1 class="meu-texto-centralizado">As 3 bases da Web</h1>
<p class="meu-texto-azul meu-texto-centralizado">
O CSS altera a apresentação de um componente HTML
@italopaiva
italopaiva / interface_segregation_principle_example.rb
Created October 4, 2017 21:20
A example of the 'I' principle in SOLID - Interface Segregation Principle
# Consider this example to illustrate the Interface Segregation Principle (ISP):
#
# Let's say that we need a interface for databases adapters called DatabaseAdapterInterface.
#
#### A bad approach that does not comply with ISP:
#
@italopaiva
italopaiva / dependency_inversion_principle_example.rb
Created October 4, 2017 17:32
A example of the 'D' principle in SOLID - Dependency Inversion Principle
# Consider the same example used in the Open-Closed Principle
# example (https://gist.github.com/italopaiva/c286351b2420ca763df3a588fc5cc3c1)
# to illustrate the Dependency Inversion Principle (DIP):
#
# Remembering the example used in the OCP principle of having a client SomeClient that uses
# a class DatabaseConnection to connect to the database and do something.
#
# In the OCP example we could achieve those results:
@italopaiva
italopaiva / liskov_substitution_principle_example.rb
Created October 4, 2017 14:45
A example of the 'L' principle in SOLID - Liskov's Substitution Principle
# Consider this Rails example to illustrate the Liskov's Substitution Principle (LSP):
#
# Domain information:
#
# - A document has a number, date, content and have a unique control number
# that is generated before saving it to the database.
# - There are several types of document, such as the ComplicatedDocument and the SimpleDocument.
# - The SimpleDocument have all attributes of a document.
# - The ComplicatedDocument is a document that only have a control number if its date is
# after 2005 (business rules), but also have a number, content, date, and it is a document.