Skip to content

Instantly share code, notes, and snippets.

Danilo Gila de Santana danilogila

View GitHub Profile
@danilogila
danilogila / chessboard.txt
Created Aug 5, 2018
Chessboard Layout with JavaScript
View chessboard.txt
let hash = "";
let tam = 8;
for(let x=0;x<tam;x++){
for(let y=0;y<tam;y++){
if((x+y)%2==0){
hash += "#";
}else{
hash+= " ";
@danilogila
danilogila / pokeapiajax.txt
Last active Feb 21, 2018
Exemplo: Fazendo Requisições AJAX na PokeAPI
View pokeapiajax.txt
function buscarPokemon(id) {
//Nossa função irá receber um ID que corresponde a qualquer Pokemon
const endpoint = "https://cors.now.sh/https://pokeapi.co/api/v2/pokemon/";
const URL = endpoint + id;
//Nossa constante "URL" será a união do endPoint da API + o ID do Pokemon
//EX: https://cors.now.sh/https://pokeapi.co/api/v2/pokemon/1" ou
// https://cors.now.sh/https://pokeapi.co/api/v2/pokemon/pikachu"
You can’t perform that action at this time.