Skip to content

Instantly share code, notes, and snippets.

View danilogila's full-sized avatar

Danilo Gila de Santana danilogila

View GitHub Profile
@danilogila
danilogila / pokeapiajax.txt
Last active February 21, 2018 18:45
Exemplo: Fazendo Requisições AJAX na PokeAPI
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"
@danilogila
danilogila / chessboard.txt
Created August 5, 2018 22:22
Chessboard Layout with JavaScript
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 / docker-compose.yml
Created June 20, 2020 17:44
Create a Postgres container with a init script. You can create your initial database tables with a init.sql file in ./data/postgres/init.sql in your project.
version: "3"
services:
database:
image: postgres:9.6
container_name: "postgres-db"
environment:
- POSTGRES_DB=db_name
- POSTGRES_USER=db_user
- POSTGRES_PASSWORD=db_password
- POSTGRES_HOST_AUTH_METHOD=trust
@danilogila
danilogila / js_linked_list.js
Last active February 22, 2021 01:00 — forked from bradtraversy/js_linked_list.js
JS Linked List Class
// Construct Single Node
class Node {
constructor(data, next = null) {
this.data = data;
this.next = next;
}
}
// Create/Get/Remove Nodes From Linked List
class LinkedList {