This file contains 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
nombre | name | nom | iso2 | iso3 | phone_code | |
---|---|---|---|---|---|---|
Afganistán | Afghanistan | Afghanistan | AF | AFG | 93 | |
Albania | Albania | Albanie | AL | ALB | 355 | |
Alemania | Germany | Allemagne | DE | DEU | 49 | |
Algeria | Algeria | Algérie | DZ | DZA | 213 | |
Andorra | Andorra | Andorra | AD | AND | 376 | |
Angola | Angola | Angola | AO | AGO | 244 | |
Anguila | Anguilla | Anguilla | AI | AIA | 1 264 | |
Antártida | Antarctica | L'Antarctique | AQ | ATA | 672 | |
Antigua y Barbuda | Antigua and Barbuda | Antigua et Barbuda | AG | ATG | 1 268 |
This file contains 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 PrivateRoute ({component: Component, authenticated, ...rest}) { | |
return ( | |
<Route | |
{...rest} | |
render={(props) => authenticated === true | |
? <Component {...props} /> | |
: <Redirect to={{pathname: '/login', state: {from: props.location}}} />} | |
/> | |
) | |
} |
This file contains 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
// | |
// Super simple base64 encoding / decoding with node.js | |
// | |
var base64 = exports = { | |
encode: function (unencoded) { | |
return new Buffer(unencoded).toString('base64'); | |
}, | |
decode: function (encoded) { | |
return new Buffer(encoded, 'base64').toString('utf8'); |
This file contains 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 whiteNumber = prompt('Ingresar un número para generar el fibonacci'); | |
function fibonacci(n = 10){ | |
let startZero = 0; | |
let startOne = 1; | |
let result; | |
let fibonacciNumbers = [0, 1]; | |
for (let i = 0; i <= n; i++) { |
This file contains 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 regex = /[0-9]/g; | |
const text = 'This is my test 123'; | |
text.replace(regex, ''); // 'This is my test ' |
This file contains 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
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |