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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<header> | |
<nav> //elementos de la abrra superior Mi Perfil, Evenetos</nav> | |
</header> | |
<main> //Contenido principal para el motor de búsqueda |
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 repo = function(){ | |
var called = 0; | |
var save = function (task){ | |
called++; | |
console.log('Saving ' + task + | |
' Called ' + called + ' times'); | |
} | |
console.log('newing up task repo'); |
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 Task = require('./task'); | |
var repoFactory = require('./repoFactorywCache'); | |
var task1 = new Task(repoFactory.getRepo('task').get(1)); | |
var task2 = new Task(repoFactory.getRepo('task').get(2)); | |
var user = repoFactory.getRepo('user').get(1); | |
var project = repoFactory.getRepo('project').get(1); | |
task1.user = user; |
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 Task = require('./task'); | |
var Repo = require('./taskRepository'); | |
var task1 = new Task(Repo.get(1)); | |
var task2 = new Task({name: 'create a demo for modules'}); | |
var task3 = new Task({name: 'create a demo for singletons'}); | |
var task4 = new Task({name: 'create a demo for prototypes'}); | |
task1.complete(); |
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 Task = require('./taskConstructorPattern'); | |
var task1 = new Task('create a demo for constructors'); | |
var task2 = new Task('create a demo for modules'); | |
var task3 = new Task('create a demo for singletons'); | |
var task4 = new Task('create a demo for prototypes'); | |
task1.complete(); | |
task2.save(); | |
task3.save(); |
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 Task = function(name){ | |
this.name=name; | |
this.completed=false; | |
this.complete = function(){ | |
console.log('completing task: ' + this.name); | |
this.completed=true; | |
} | |
this.save = function(){ |
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
A(); | |
function C() { | |
console.log("C"); | |
d(); | |
} | |
function E(f) { | |
console.log("E"); | |
f(); |
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 taxRate = 0.07; | |
const phonePrice = Number(prompt("What is the price for the phone you are looking for?")); | |
const accessoryPrice = Number(prompt("How much bucks does the accesory cost?")); | |
const spendingThreshold = 200; | |
var accountBalance = Number(prompt("How much IS YOUR BANK ACCOUNT?")); | |
function calculateTax(purchasePrice){ | |
return purchasePrice + purchasePrice*taxRate; |
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
//A function to check if n is reachable which whatever pair's sum in arr | |
//Esta función está creadar por Samer Buna, el resto del código es mío siguiendo su curso en | |
// https://app.pluralsight.com/library/courses/react-js-getting-started/table-of-contents | |
//Instructions execute it on https://jscomplete.com/repl/ | |
var possibleCombinationSum = function(arr, n) { | |
if (arr.indexOf(n) >= 0) { return true; } | |
if (arr[0] > n) { return false; } | |
if (arr[arr.length - 1] > n) { | |
arr.pop(); | |
return possibleCombinationSum(arr, n); |
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 Stars = (props) => { | |
/* | |
let stars = []; | |
for(let i=0; i<numberOfStars; i++){ | |
stars.push(<i key={i} className="fa fa-star"></i>); | |
} | |
*/ | |
return ( | |
<div className="col-5"> |
NewerOlder