Skip to content

Instantly share code, notes, and snippets.

View rachel-yankelevitz's full-sized avatar

Rachel Yankelevitz rachel-yankelevitz

View GitHub Profile
@rachel-yankelevitz
rachel-yankelevitz / gist:51e91b4dff86373c059dc45b0bebe5db
Created August 9, 2017 05:51
HTML page building with Kaltura
<!DOCTYPE html>
<html>
<head>
<title>kaltura video</title>
<style>
#player{
margin: auto;
text-align: center;
}
</style>
$(document).ready(function(){
// Array to store all feed sources
var SOURCES = [
{
displayName: "Reddit",
url: "https://www.reddit.com/r/worldnews/top/.json",
proxyRequired: true,
defaultSource: true, // You can have only one default source
formatResponse: function(response) {
@rachel-yankelevitz
rachel-yankelevitz / gist:c049063f4f8c59fbce5fba099d795e04
Created April 24, 2017 18:37
Homework 3 underscore map.js description
var _ = { ///<-- This is the creation of a variable called "_" which is a method
map: function(list, cbFn) { ///<-- on this line the first key value is function (so a function within the variable method). This function will take to params: list and cbFn
var newArray = []; /// within the method's function, there is a new local variable, newArray, which is an empty array
list.forEach(function(elem, index) { ///<-- on this line we're showing each element/item created by the parameter "list"
var newElem = cbFn(elem, index); ///<-- creating a new variable using the CbFn parameter and the elements and index generated by the list function
newArray.push(newElem); /// <-- the newArray variable is using the push vanilla JS method to create an array using the dynamic variables created by newElem
}); ///<-- this is closing the list.forEach function
return newArray; ///<-- this is the final result of the newArray varaible created by the nested function
$(document).ready(function(){
var todoCollection = [];
$(".main, .footer").hide();
$(".new-todo").keypress(function(e) {
// enter key's key number is 13
if (e.which === 13 && $(this).val().length > 1){
@rachel-yankelevitz
rachel-yankelevitz / Open Weather App API key
Created April 16, 2017 23:25
Open Weather App API Key
b57be26bd9b78e4945d93dc11db8a617
// Question 1
// Convert every price in `prices` into a number using a function that returns an array.
// Store the resulting array in a variable named `numPricesArray`. You should not mutuate `prices`.
// To see your work, log out the string "numPricesArray" and the actual variable afterwards.
// function convert(){
// Number(prices);
// console.log(convert);
// }
// WRITE QUESTION 1 ANSWER HERE
// Homework 1
// Hint: You may need SOME of these array iterator methods:
// .map(), .filter(), .forEach() , .some(), .every()
// Hint: You may also need SOME of the following methods:
// Number(), .reverse(), typeof(), .join()
// Let's say we have an array of prices named `prices`.
var prices = ['100', '125', '129', '37', '38', '75', '87', '94', '300', '301',
'305', '50', '0.30', '0.01', '0.5', '5', '15', '24', '35', '1041', '1', '17',
console.log("hello world");