Skip to content

Instantly share code, notes, and snippets.

View desinas's full-sized avatar

Dimitrios Kalkasinas desinas

View GitHub Profile
@desinas
desinas / quizFizzbuzz.js
Last active December 20, 2017 08:21
Julia James Quiz (4-1) from Udacity Frond end developer
/*
* Programming Quiz: JuliaJames (4-1)
*/
//version using an extra string for concatecate the result
var x = 1;
while (x < 21) {
fizzbuzz = ""; //string init in every loop cycle
if (x%3 === 0) fizzbuzz += "Julia"; //concat Julia if x mod 3 equals 0
if (x%5 === 0) fizzbuzz += "James"; //concat James if x mod 5 equals 0
@desinas
desinas / quizInline.js
Last active December 20, 2017 08:01
Inline Quiz (5-6) of Udacity FEWD
/*
* Programming Quiz: Inline Functions (5-6)
*/
// don't change this code
function emotions(myString, myFunc) {
console.log("I am " + myString + ", " + laugh(2));
}
// your code goes here
@desinas
desinas / quizGotBills.js
Last active February 19, 2021 10:23
I got bills Quiz (6-9) of Udacity FEWD
/*
* Programming Quiz: I Got Bills (6-9)
*
* Use the .map() method to take the bills array below and create a second array
* of numbers called totals. The totals array should contains each amount from the
* bills array but with a 15% tip added. Log the totals array to the console.
*
* For example, the first two entries in the totals array would be:
*
* [57.76, 21.99, ... ]
@desinas
desinas / quizNestedNumb.js
Last active March 19, 2019 12:51
Nested numbers Quiz (6-10) of Udacity FEWD
/*
* Programming Quiz: Nested Numbers (6-10)
*
* - The `numbers` variable is an array of arrays.
* - Use a nested `for` loop to cycle through `numbers`.
* - Convert each even number to the string "even"
* - Convert each odd number to the string "odd"
*/
var numbers = [
@desinas
desinas / quizUmbrella.js
Last active December 21, 2017 10:22
Umbrella Quiz (7-11) of Udacity FEWD
/*
* Programming Quiz: Umbrella (7-1)
*/
var umbrella = {
color: "pink",
isOpen: true,
open: function() {
if (umbrella.isOpen === true) {
return "The umbrella is already opened!";
@desinas
desinas / quizFacebookFriends.js
Last active January 17, 2020 06:50
Facebook friends Quiz (7-5) of Udacity FEWD
/*
* Programming Quiz: Facebook Friends (7-5)
*
* Create an object called facebookProfile. The object should have 3 properties:
* your name
* the number of friends you have, and
* an array of messages you've posted (as strings)
* The object should also have 4 methods:
* postMessage(message) - adds a new message string to the array
* deleteMessage(index) - removes the message corresponding to the index provided
@desinas
desinas / app.js
Created December 23, 2017 14:59
$( function ) Quiz of lesson 19 from Udacity FEWD
/*
For this quiz, can you use this script, which is linked in the <head> of index.html,
to change the boring placeholder image to a picture of a cute animal?
Remember, you'll need to pass a function into the jQuery object to run
when the document is ready.
Unfortunately, placepuppy is no longer available. Here's a link to a random
animal image on lorempixel.com:
@desinas
desinas / _Contacts-onReact-srcApp.js
Last active July 18, 2018 15:05
part of Contacts app after bootstrapping w/ Create React app of Udacity React nano-degree
import React, { Component } from 'react';
import { Route } from 'react-router-dom'
import ListContacts from './ListContacts'
import CreateContact from './CreateContact'
import * as ContactsAPI from './utils/ContactsAPI'
class App extends Component {
state = {
contacts: []
}