This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const urlFriendlyHandler = (string) => | |
| string.toLowerCase().trim() | |
| .replace(/[áàãâä]/g, "a") | |
| .replace(/[éè?êë]/g, "e") | |
| .replace(/[íìiîï]/g, "i") | |
| .replace(/[óòõôö]/g, "o") | |
| .replace(/[úùuûü]/g, "u") | |
| .replace(/ç/g, "c") | |
| .replace(/(\ |_)+/, " ") | |
| .replace(/(^-+|-+$)/, "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function initMap () { | |
| let options = { | |
| zoom: 12, | |
| center: {lat:-23.550084,lng:-46.6381307} | |
| } | |
| let map = new google.maps.Map(document.getElementById('map'), options) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <pub-header></pub-header> | |
| <!-- BODY WIDGET --> | |
| <div class="panel-body"> | |
| <!-- TABLE --> | |
| <table class="table"> | |
| <thead> | |
| <tr> | |
| <th>Nome</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const domElement = function (selector) { | |
| this.selector = selector || null | |
| this.element = null | |
| this.events = []; | |
| const bindEvent = (event, callback, targetElement) => { | |
| _removeBind(event, targetElement) | |
| targetElement.addEventListener(event, callback, false) | |
| this.events.push({ type: event, event: callback, target: targetElement }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Menu = (()=> { | |
| 'use strict' | |
| const addEvent = ( event ) => ( element, action ) => | |
| element.addEventListener( event, action(element) ) | |
| const addClass = ( _class ) => ( element ) => | |
| element.classList.add( _class ); | |
| const removeClass = ( _class ) => ( element ) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Template () { | |
| this.markupMenuFull = () => { | |
| return (` | |
| <header class="l-header" role="banner"> | |
| <div class="l-header__channel"> | |
| <div class="l-header__channel__bg"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let Menu = (()=> { | |
| 'use strict' | |
| const api = new Api(); | |
| const template = new Template(); | |
| const $ = (el) => document.querySelector(el) | |
| const displayWidth = () => window.innerWidth | |
| const headerMenuFull = $('#container-menu'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express') | |
| const app = express() | |
| const port = 3000 | |
| app.get('/somar', (request, response) => { | |
| let soma = 0; | |
| if(request.query && request.query.num1 && request.query.num2){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const readdirPromise = (path) => { | |
| return new Promise((resolve, reject) => { | |
| fs.stat(path, (err, stat) => { | |
| if(err){ | |
| reject(err) | |
| }else{ | |
| resolve(stat.isFile()) | |
| } | |
| }) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs') | |
| const path = "./" | |
| const readdirPromise = (path) => { | |
| return new Promise((resolve, reject) => { | |
| fs.readdir(path, (err, files) => { | |
| if(err){ | |
| reject(err) | |
| }else{ |