Skip to content

Instantly share code, notes, and snippets.

@YoneMoreno
YoneMoreno / index.html
Created November 6, 2017 11:57
Indice HTML5
<!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
var repo = function(){
var called = 0;
var save = function (task){
called++;
console.log('Saving ' + task +
' Called ' + called + ' times');
}
console.log('newing up task repo');
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;
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();
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();
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(){
@YoneMoreno
YoneMoreno / exercise1KyleAdvancedJS.js
Created November 3, 2017 09:55
Tring to print all letter from A - Z with rules: # Instructions 1. Fix the code so it prints out the alphabet A-Z in the console. 2. Cannot: - Have **any** global variables at all - Delete or combine any function declarations - Create any new functions (except IIFEs -- hint!) - Rearrange the order of declarations 3. Can/must: - Declare extra var…
A();
function C() {
console.log("C");
d();
}
function E(f) {
console.log("E");
f();
@YoneMoreno
YoneMoreno / PracticeGoing&UpYDKJS.js
Created November 1, 2017 07:36
Doing the practice excercise in the first chapter of the book by Kyle called You Dont Know Javascript Going & Up
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;
@YoneMoreno
YoneMoreno / FinalMathGameWIthReact.js
Last active November 8, 2017 20:26
Samer Buna Getting Started with React
//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);
@YoneMoreno
YoneMoreno / DoneStatus.js
Created October 30, 2017 09:59
Samer Buna React
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">