Skip to content

Instantly share code, notes, and snippets.

View eliabeleal's full-sized avatar
🎯
Focusing

Eliabe Leal eliabeleal

🎯
Focusing
View GitHub Profile
const express = require('express')
const LocationController = require('./controllers/LocationController')
const UserController = require('./controllers/UserController')
const routes = express.Router()
routes.post('/users', UserController.store)
module.exports = routes
@eliabeleal
eliabeleal / server.js
Last active August 19, 2019 12:13
Conectando PostgreSQL (Sequelize) e MongoDB em uma mesma aplicação Node.js
const express = require('express')
const mongoose = require('mongoose')
const routes = require('./routes')
const server = express();
mongoose.connect('mongodb://localhost/mydb', { useNewUrlParser: true })
server.use(express.json())
server.listen(3333);
function nomeDaFuncao ([param] …) {
expressions
}
function ([param] …) expression
([param] …) => {
statements
}
const addressInput = document.querySelector('#address-input')
const ipInfoBtn = document.querySelector('#ip-info-btn')
const ipInfoField = document.querySelector('#ip-info')
ipInfoBtn.addEventListener('click', () => {
ipInfoField.innerHTML = '<img src="img/loading.gif">'
let address = addressInput.value
let url = `https://ipinfo.io/${address}/json`
fetch(url)
@eliabeleal
eliabeleal / HTML5Shiv.html
Created March 24, 2017 12:24
Estrutura semântica do HTML
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<figure>
<img src="#" alt="#">
<figcaption>Three Angels Dancing</figcaption>
</figure>
@eliabeleal
eliabeleal / CD_em_SGML_DTD.html
Created March 24, 2017 11:02
Estrutura semântica do HTML
<fig id=angelfig>
<figbody>
<artwork depth=24p>
<figcap>Three Angels Dancing
</fig>
@eliabeleal
eliabeleal / CD_em_SGML.html
Last active March 24, 2017 10:59
Estrutura semântica do HTML
<fig id=angelfig>
<figbody>
<artwork depth=24p>
</artwork>
</figbody>
<figcap>Three Angels Dancing</figcap>
</fig>