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(wndw) { | |
var Browsers, OS, Platform, Versions, browser_name, browser_version, os, platform; | |
Versions = { | |
Firefox: /firefox\/([\d\w\.\-]+)/i, | |
IE: /msie\s([\d\.]+[\d])/i, | |
Chrome: /chrome\/([\d\w\.\-]+)/i, | |
Safari: /version\/([\d\w\.\-]+)/i, | |
Ps3: /([\d\w\.\-]+)\)\s*$/i, | |
Psp: /([\d\w\.\-]+)\)?\s*$/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
{ | |
"name": "styleguide", | |
"version": "0.0.1", | |
"description": "Laboratoria styleguides", | |
"main": "index.js", | |
"style": "dist/main.css", | |
"sass": "sass/main.scss", | |
"scripts": { | |
"build": "node-sass --include-path sass sass/main.scss dist/main.css" | |
}, |
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 get = url => { | |
return new Promise((resolve, reject) => { | |
var xhr = new XMLHttpRequest(); | |
xhr.addEventListener('load', _ => { | |
if (xhr.status !== 200) { | |
reject(new Error(xhr.statusText)); | |
} | |
resolve(xhr.response); | |
}); | |
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
var myPromise = new Promise((resolve, reject) => { | |
//Instrucciones que se van a ejecutar | |
if(/* Termino correctamente */) { | |
resolve('Success!'); | |
} else { | |
reject('Failure!'); | |
} | |
}); |
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
fs.readdir(source, function (err, files) { | |
if (err) { | |
console.log('Error finding files: ' + err) | |
} else { | |
files.forEach(function (filename, fileIndex) { | |
console.log(filename) | |
gm(source + filename).size(function (err, values) { | |
if (err) { | |
console.log('Error identifying file size: ' + err) | |
} else { |
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 stations = [{id: 1, name: "Pardo"}, {id: 2, name: "Benavides"}]; | |
// Map, reduce y Filter son clasicos ejemplos de callback, | |
// donde se delega la lógica detrás del map a una función externa haciéndo | |
// reutilizable el código | |
const stationNames = stations.map((station) => { | |
return station.name; | |
}); |
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 callback = () => { | |
console.log('Llamando a mi callback'); | |
} | |
function otraFuncion(callback) { | |
console.log('Ejecutando otra funcion'); | |
callback(); | |
} | |
//Funcion anonima que funciona como callback |
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
console.log('Primero'); | |
setTimeout(_ => { | |
console.log('Segundo'); | |
},10); | |
console.log('Tercero'); |
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
console.log('Primero'); | |
console.log('Segundo'); | |
console.log('Tercero'); |
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
<script id="myTemplate" type="text/x-handlebars-template"> | |
<h1>{{title}}</h1> | |
<ul> | |
{{#names}} | |
<li>{{name}}</li> | |
{{/names}} | |
</ul> | |
</script> |
NewerOlder