Skip to content

Instantly share code, notes, and snippets.

View brunowmoreno's full-sized avatar

Bruno Queiroz brunowmoreno

  • FMP/FASE
  • Petrópolis, Rio de Janeiro, Brasil
View GitHub Profile
@brunowmoreno
brunowmoreno / get.js
Created March 15, 2018 20:06 — forked from rafaelstz/get.js
AJAX GET and POST with pure Javascript
// Exemplo de requisição GET
var ajax = new XMLHttpRequest();
// Seta tipo de requisição e URL com os parâmetros
ajax.open("GET", "minha-url-api.com/?name=Henry&lastname=Ford", true);
// Envia a requisição
ajax.send();
// Cria um evento para receber o retorno.
@brunowmoreno
brunowmoreno / basic_router.jsx
Created March 2, 2018 14:52 — forked from siakaramalegos/basic_router.jsx
Basic example of React Router: BrowserRouter, Link, Route, and Switch
// BrowserRouter is the router implementation for HTML5 browsers (vs Native).
// Link is your replacement for anchor tags.
// Route is the conditionally shown component based on matching a path to a URL.
// Switch returns only the first matching route rather than all matching routes.
import {
BrowserRouter as Router,
Link,
Route,
Switch,
} from 'react-router-dom';